{"thread":{"id":"12060","subject":"git apply fails because of 'index xxxxxxx..yyyyyyy' line?","startedAt":"2008-02-12T18:55:30Z","lastAt":"2008-02-12T18:55:30Z","messageCount":1,"participants":["Nikita V. Youshchenko"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"68539","messageId":"1358330.RVoaTMz8tR@yoush.homelinux.org","threadId":"12060","inReplyTo":null,"subject":"git apply fails because of 'index xxxxxxx..yyyyyyy' line?","fromName":"Nikita V. Youshchenko","fromEmail":"yoush@debian.org","sentAt":"2008-02-12T18:55:30Z","receivedAt":"2008-02-12T18:55:30Z","isPatch":false,"sender":{"key":"yoush@debian.org","avatar":null},"body":"Hello\n\nI was playing with 'git quiltimport' feature, trying to import a large quilt\npatchset (coming from vendor) into a local git repository containing linux\nkernel tree.\n\nSome of quilt patches in the patchset have been created by picking single\ngit commits, likely with 'git show XXXXXX > file.patch.\n\nAnd I found that such patches fail to apply with 'git apply' (which is\ninternally used by 'git quiltimport'). Git complains:\n\nfatal: patch with only garbage at line 3\n\nHowever, if I edit patch file and add a space before the\n'index XXXXXXX..YYYYYYY' in the header, then patch applies cleanly!\n\nAlso, some patches did not apply with error message that looked like\n\nerror: removal patch leaves file contents\nerror: arch/arm/mm/mmu.c: patch does not apply\n\nBut these patches applied cleanly after I addeed a space before\n'deleted file mode XXXXXX' lines.\n\nFinally, some patches fauled to apply, with error message\n\nfatal: patch with only garbage at line 3\n\nbut applied cleanly after I added a space before\n'dissimilarity index XX%' line.\n\nThe mentioned addition of spaces do not modify patches themselves. But it\nmakes 'git apply' happy.\n\nI'm confused.\nCould someone please comment on this?\nIsn't it a bug in 'git apply'?\n"}]}