{"thread":{"id":"43879","subject":"git format-patch --break-rewrites broken in 2.9.3","startedAt":"2016-08-18T14:46:14Z","lastAt":"2016-08-19T18:41:47Z","messageCount":11,"participants":["Olaf Hering","Johannes Schindelin","Junio C Hamano","Jeff King","Matthieu Moy","Philip Oakley","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"299617","messageId":"20160818144421.GA9062@aepfle.de","threadId":"43879","inReplyTo":null,"subject":"git format-patch --break-rewrites broken in 2.9.3","fromName":"Olaf Hering","fromEmail":"olaf@aepfle.de","sentAt":"2016-08-18T14:44:21Z","receivedAt":"2016-08-18T14:46:14Z","isPatch":false,"sender":{"key":"olaf@aepfle.de","avatar":"https://avatars.githubusercontent.com/u/942324?v=4"},"body":"This command used to create a diff which can be consumed by patch. But\nat least with 2.9.3 it just gives a rename output:\n\n git format-patch \\\n        --no-signature \\\n        --stdout \\\n        --break-rewrites \\\n        --keep-subject \\\n 95fa0405c5991726e06c08ffcd8ff872f7fb4f2d^..95fa0405c5991726e06c08ffcd8ff872f7fb4f2d\n\n\nWhat must be done now to get a usable patch?\n\nOlaf\n"},{"id":"299618","messageId":"alpine.DEB.2.20.1608181713440.4924@virtualbox","threadId":"43879","inReplyTo":"20160818144421.GA9062@aepfle.de","subject":"Re: git format-patch --break-rewrites broken in 2.9.3","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-08-18T15:15:08Z","receivedAt":"2016-08-18T16:27:05Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Olaf,\n\nOn Thu, 18 Aug 2016, Olaf Hering wrote:\n\n> This command used to create a diff which can be consumed by patch. But\n> at least with 2.9.3 it just gives a rename output:\n> \n>  git format-patch \\\n>         --no-signature \\\n>         --stdout \\\n>         --break-rewrites \\\n>         --keep-subject \\\n>  95fa0405c5991726e06c08ffcd8ff872f7fb4f2d^..95fa0405c5991726e06c08ffcd8ff872f7fb4f2d\n> \n> \n> What must be done now to get a usable patch?\n\nMaybe --no-renames? BTW this behavior was not introduced in 2.9.3, but in\n2.9.0:\n\nhttps://github.com/git/git/blob/v2.9.0/Documentation/RelNotes/2.9.0.txt#L7-L9\n\nCiao,\nJohannes\n"},{"id":"299621","messageId":"xmqq7fbe6l7y.fsf@gitster.mtv.corp.google.com","threadId":"43879","inReplyTo":"alpine.DEB.2.20.1608181713440.4924@virtualbox","subject":"Re: git format-patch --break-rewrites broken in 2.9.3","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-08-18T17:27:45Z","receivedAt":"2016-08-18T19:25:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi Olaf,\n>\n>>         --break-rewrites \\\n>>         --keep-subject \\\n>>  95fa0405c5991726e06c08ffcd8ff872f7fb4f2d^..95fa0405c5991726e06c08ffcd8ff872f7fb4f2d\n>> \n>> What must be done now to get a usable patch?\n>\n> Maybe --no-renames? BTW this behavior was not introduced in 2.9.3, but in\n> 2.9.0:\n>\n> https://github.com/git/git/blob/v2.9.0/Documentation/RelNotes/2.9.0.txt#L7-L9\n\nI think that is one half of the story.\n\nThe other half is a long/well known bug that lets \"diff -B -M\" to\nproduce incorrect/broken patch that cannot be applied.  It was\ndocumented in the thread that begins at:\n\n    public-inbox.org/git/xmqqfvapuhkk.fsf@gitster.dls.corp.google.com\n\nbut still hasn't been solved.\n"},{"id":"299622","messageId":"xmqqk2fd6c83.fsf@gitster.mtv.corp.google.com","threadId":"43879","inReplyTo":"xmqq7fbe6l7y.fsf@gitster.mtv.corp.google.com","subject":"Re: git format-patch --break-rewrites broken in 2.9.3","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-08-18T20:42:04Z","receivedAt":"2016-08-19T01:08:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I think that is one half of the story.\n>\n> The other half is a long/well known bug that lets \"diff -B -M\" to\n> produce incorrect/broken patch that cannot be applied.  It was\n> documented in the thread that begins at:\n>\n>     public-inbox.org/git/xmqqfvapuhkk.fsf@gitster.dls.corp.google.com\n>\n> but still hasn't been solved.\n\nThe problem report actually starts here:\n\n    public-inbox.org/git/xmqqegqaahnh.fsf@gitster.dls.corp.google.com/\n\n"},{"id":"299623","messageId":"20160818150522.56gdx2mhgo7qwvru@sigill.intra.peff.net","threadId":"43879","inReplyTo":"20160818144421.GA9062@aepfle.de","subject":"Re: git format-patch --break-rewrites broken in 2.9.3","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-08-18T15:05:22Z","receivedAt":"2016-08-19T01:08:55Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Aug 18, 2016 at 04:44:21PM +0200, Olaf Hering wrote:\n\n> This command used to create a diff which can be consumed by patch. But\n> at least with 2.9.3 it just gives a rename output:\n> \n>  git format-patch \\\n>         --no-signature \\\n>         --stdout \\\n>         --break-rewrites \\\n>         --keep-subject \\\n>  95fa0405c5991726e06c08ffcd8ff872f7fb4f2d^..95fa0405c5991726e06c08ffcd8ff872f7fb4f2d\n> \n> \n> What must be done now to get a usable patch?\n\nProbably --no-renames.\n\nRenames were enabled by default by 5404c11 (diff: activate diff.renames\nby default, 2016-02-25), which is in v2.9.0.\n\nI wonder if we should consider undoing that for format-patch, whose\noutput may be consumed by non-git endpoints.\n\n-Peff\n"},{"id":"299624","messageId":"20160818154022.5mp4cr5jq57doh3d@sigill.intra.peff.net","threadId":"43879","inReplyTo":"vpqa8gayumw.fsf@anie.imag.fr","subject":"Re: git format-patch --break-rewrites broken in 2.9.3","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-08-18T15:40:22Z","receivedAt":"2016-08-19T01:08:56Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Aug 18, 2016 at 05:16:55PM +0200, Matthieu Moy wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > On Thu, Aug 18, 2016 at 04:44:21PM +0200, Olaf Hering wrote:\n> >\n> >> This command used to create a diff which can be consumed by patch. But\n> >> at least with 2.9.3 it just gives a rename output:\n> >> \n> >>  git format-patch \\\n> >>         --no-signature \\\n> >>         --stdout \\\n> >>         --break-rewrites \\\n> >>         --keep-subject \\\n> >>  95fa0405c5991726e06c08ffcd8ff872f7fb4f2d^..95fa0405c5991726e06c08ffcd8ff872f7fb4f2d\n> >> \n> >> \n> >> What must be done now to get a usable patch?\n> >\n> > Probably --no-renames.\n> >\n> > Renames were enabled by default by 5404c11 (diff: activate diff.renames\n> > by default, 2016-02-25), which is in v2.9.0.\n> >\n> > I wonder if we should consider undoing that for format-patch, whose\n> > output may be consumed by non-git endpoints.\n> \n> I would say no (or more precisely: we should consider, but we should\n> reject the idea ;-) ), since patches with renames are useful and can be used\n> even outside Git's scope. GNU patch, which is probably the most widely\n> used implementation of patch supports git-style renames since 2.7,\n> released in September 2012.\n\nAh, OK; I didn't realize GNU patch had picked up rename support. I agree\nthat makes it less-bad for format-patch to start using them by default.\nOlaf, what version of patch are you using?\n\n-Peff\n"},{"id":"299625","messageId":"20160818151544.7rhfe7cetl3hp3b5@sigill.intra.peff.net","threadId":"43879","inReplyTo":"20160818150522.56gdx2mhgo7qwvru@sigill.intra.peff.net","subject":"Re: git format-patch --break-rewrites broken in 2.9.3","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-08-18T15:15:45Z","receivedAt":"2016-08-19T01:08:57Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Aug 18, 2016 at 11:05:22AM -0400, Jeff King wrote:\n\n> On Thu, Aug 18, 2016 at 04:44:21PM +0200, Olaf Hering wrote:\n> \n> > This command used to create a diff which can be consumed by patch. But\n> > at least with 2.9.3 it just gives a rename output:\n> > \n> >  git format-patch \\\n> >         --no-signature \\\n> >         --stdout \\\n> >         --break-rewrites \\\n> >         --keep-subject \\\n> >  95fa0405c5991726e06c08ffcd8ff872f7fb4f2d^..95fa0405c5991726e06c08ffcd8ff872f7fb4f2d\n> > \n> > \n> > What must be done now to get a usable patch?\n> \n> Probably --no-renames.\n> \n> Renames were enabled by default by 5404c11 (diff: activate diff.renames\n> by default, 2016-02-25), which is in v2.9.0.\n> \n> I wonder if we should consider undoing that for format-patch, whose\n> output may be consumed by non-git endpoints.\n\nBy the way, this probably has nothing to do with --break-rewrites in\nparticular. It would come up for any case where git finds a rename. In\nthe absence of --break-rewrites, that requires a path being deleted and\none being added. But in this particular case, --break-rewrites turns a\nlarge change into a delete/add pair, which lets git find the rename.\n\nSo it's a necessary option to show the problem in _this_ instance, but\nthere are other cases that would not need it.\n\n-Peff\n"},{"id":"299657","messageId":"vpq60qyxdau.fsf@anie.imag.fr","threadId":"43879","inReplyTo":"20160818154813.GB9062@aepfle.de","subject":"Re: git format-patch --break-rewrites broken in 2.9.3","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-08-18T16:16:41Z","receivedAt":"2016-08-19T01:43:58Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Olaf Hering <olaf@aepfle.de> writes:\n\n> On Thu, Aug 18, Jeff King wrote:\n>\n>> Olaf, what version of patch are you using?\n>\n> Mostly 2.7.x, but also add 2.5.x to the mix.\n> So far I did not try what the tools dealing with the resulting patch\n> file would actually do with such a stripped down variant.\n\nI think the way to go is --no-renames until you stop using patch <2.7.\nIf you don't want to specify it each time, you can revert to the pre-2.9\nbehavior by setting\n\n[diff]\n\trenames = false\n\nin ~/.gitconfig.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"299658","messageId":"20160818154813.GB9062@aepfle.de","threadId":"43879","inReplyTo":"20160818154022.5mp4cr5jq57doh3d@sigill.intra.peff.net","subject":"Re: git format-patch --break-rewrites broken in 2.9.3","fromName":"Olaf Hering","fromEmail":"olaf@aepfle.de","sentAt":"2016-08-18T15:48:13Z","receivedAt":"2016-08-19T01:49:16Z","isPatch":false,"sender":{"key":"olaf@aepfle.de","avatar":"https://avatars.githubusercontent.com/u/942324?v=4"},"body":"On Thu, Aug 18, Jeff King wrote:\n\n> Olaf, what version of patch are you using?\n\nMostly 2.7.x, but also add 2.5.x to the mix.\nSo far I did not try what the tools dealing with the resulting patch\nfile would actually do with such a stripped down variant.\n\nOlaf\n"},{"id":"299724","messageId":"04D3C5DBA44C4AC48D0D846B337D2EE0@PhilipOakley","threadId":"43879","inReplyTo":"20160818144421.GA9062@aepfle.de","subject":"Re: git format-patch --break-rewrites broken in 2.9.3","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2016-08-19T18:04:50Z","receivedAt":"2016-08-19T18:05:51Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On Thu, Aug 18, 2016 at 04:44:21PM +0200, Olaf Hering wrote:\n\n> This command used to create a diff which can be consumed by patch. But\n> at least with 2.9.3 it just gives a rename output:\n>\n>  git format-patch \\\n>         --no-signature \\\n>         --stdout \\\n>         --break-rewrites \\\n>         --keep-subject \\\n> \n> 95fa0405c5991726e06c08ffcd8ff872f7fb4f2d^..95fa0405c5991726e06c08ffcd8ff872f7fb4f2d\n>\n>\n> What must be done now to get a usable patch?\n\nAs an aside, the range can be shortened to\n\n95fa0405c5991726e06c08ffcd8ff872f7fb4f2d^!\n\nIt's something I picked up when doing the doc update on 'specifying \nrevisions'.\n\n--\n\nPhilip\n\n"},{"id":"299728","messageId":"87inuwiota.fsf@linux-m68k.org","threadId":"43879","inReplyTo":"04D3C5DBA44C4AC48D0D846B337D2EE0@PhilipOakley","subject":"Re: git format-patch --break-rewrites broken in 2.9.3","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2016-08-19T18:41:37Z","receivedAt":"2016-08-19T18:41:47Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Aug 19 2016, \"Philip Oakley\" <philipoakley@iee.org> wrote:\n\n> On Thu, Aug 18, 2016 at 04:44:21PM +0200, Olaf Hering wrote:\n>\n>> This command used to create a diff which can be consumed by patch. But\n>> at least with 2.9.3 it just gives a rename output:\n>>\n>>  git format-patch \\\n>>         --no-signature \\\n>>         --stdout \\\n>>         --break-rewrites \\\n>>         --keep-subject \\\n>>\n>> 95fa0405c5991726e06c08ffcd8ff872f7fb4f2d^..95fa0405c5991726e06c08ffcd8ff872f7fb4f2d\n>>\n>>\n>> What must be done now to get a usable patch?\n>\n> As an aside, the range can be shortened to\n>\n> 95fa0405c5991726e06c08ffcd8ff872f7fb4f2d^!\n\nIn the context of format-patch you can also use -1 to select the topmost\ncommit from the list.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"}]}