After making changes you may want to split these changes up into several commits but some of the changes may be in the same file. If you then use git-gui to stage different lines in one file and the last line in this file is part of the diff from HEAD then git-gui will produce an error “corrupt patch”
It is not clear to me how to work around this