{"thread":{"id":"13889","subject":"git-apply quirks","startedAt":"2008-06-10T19:40:00Z","lastAt":"2008-06-10T19:40:00Z","messageCount":1,"participants":["Don Zickus"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"79379","messageId":"20080610194000.GD9304@redhat.com","threadId":"13889","inReplyTo":null,"subject":"git-apply quirks","fromName":"Don Zickus","fromEmail":"dzickus@redhat.com","sentAt":"2008-06-10T19:40:00Z","receivedAt":"2008-06-10T19:40:00Z","isPatch":false,"sender":{"key":"dzickus@redhat.com","avatar":null},"body":"Hi.\n\nI work with a lot of backporting of patches and there are times when\npeople combine multiple patches together such that the resulting patch can\nhave multiple chunks changing the same file.  I have noticed git-apply\ndoes not handle this case correctly.  It usually ignores all previous\nchunks and only applies the last one.\n\nThe same scenario can also cause git-apply to fail if a later patch chunk\ndepends on changes from an earlier patch chunk.\n\nThe traditional 'patch' command seems to handle the successfully.  Is this\ngit-apply behaviour intended or is it a bug?\n\nThe following example summarizes the problem:\n\n#cd <some git repo>\n# cat > dummy << EOF\nThis is\na\ntest\nof\ngit-apply\ndoing\nsomething\nincorrectly.\n\nPlease\nhelp.\n\nEOF\n#git-add dummy\n#git commit -m 'test'\n#git-apply <attached patch below>\n\nYou will notice in the git-diff output the first chunk is ignored and only\nthe second applies.\n\nCheers,\nDon\n\n\ndiff a/dummy b/dummy\n--- a/dummy\n+++ b/dummy\n@@ -1,5 +1,5 @@\n This is\n-a\n+the first\n test\n of\n git-apply\n\ndiff a/dummy b/dummy\n--- a/dummy\n+++ b/dummy\n@@ -6,6 +6,8 @@ git-apply\n doing\n something\n incorrectly.\n+Now here is the\n+second test.\n \n Please\n help.\n"}]}