From: 4jxdq6fqee2h@dyweni.com Date: Wed, 25 Feb 2009 15:03:22 GMT Subject: Bug in Git-Gui - Creates corrupt patch Message-ID: <20090225090322.301cdb77@family.dyweni.com> Hi Shawn, I have stumbled upon a bug in Git-GUi and am providing reproduction steps: 1. Commit this file into a new git repository: ----------------------------- -------------- Here is the base64 encoded version: PD9waHAKCmNsYXNzIG15Y2xhc3MgewoJcHVibGljIGZ1bmN0aW9uIGZ1bmNBYmMoKSB7CgkJZWNo byAibGluZSAxIjsKCQllY2hvICJsaW5lIDIiOwoJCWVjaG8gImxpbmUgMyI7CgkJZWNobyAibGlu ZSA0IjsKCQllY2hvICJsaW5lIDUiOwoJfQoJCglwdWJsaWMgZnVuY3Rpb24gZnVuY0JDRCgpIHsK CQllY2hvICJsaW5lIDEtMSI7CgkJZWNobyAibGluZSAyLTEiOwoJCWVjaG8gImxpbmUgMy0xIjsK CQllY2hvICJsaW5lIDQtMSI7CgkJZWNobyAibGluZSA1LTEiOwoJfQp9Cgo/Pg== 2. Now delete the last function in the class. Here's the resulting file, it is not staged or commited yet. ---------------------------- ---------------------------- Here is the base64 encoded version: PD9waHAKCmNsYXNzIG15Y2xhc3MgewoJcHVibGljIGZ1bmN0aW9uIGZ1bmNBYmMoKSB7CgkJZWNo byAibGluZSAxIjsKCQllY2hvICJsaW5lIDIiOwoJCWVjaG8gImxpbmUgMyI7CgkJZWNobyAibGlu ZSA0IjsKCQllY2hvICJsaW5lIDUiOwoJfQp9Cgo/Pg== 3. Using git-gui, try to stage *only* the last line marked for removal (should be '- }'). I get 'fatal: corrupt patch at line 22'. 4. Now try the same task using git-add -p. Start 'git-add -p'. Enter edit mode (e). Remove all the '-' lines except the last one (make them ' ') so that only the last '-' will be removed. Save and exit. On my system the patch is committed. I'm running git version 1.6.0.6, 32bit linux, Gentoo OS