{"thread":{"id":"24960","subject":"Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c","startedAt":"2010-09-03T18:23:23Z","lastAt":"2010-09-04T22:26:08Z","messageCount":16,"participants":["Uwe Kleine-König","Jonathan Nieder","Russell King - ARM Linux","Matthieu Moy","Andreas Schwab","Andreas Gruenbacher","Jean-Christophe PLAGNIOL-VILLARD"],"isPatch":true,"patchVersion":3,"patchTotal":null},"messages":[{"id":"149772","messageId":"20100903182323.GA17152@pengutronix.de","threadId":"24960","inReplyTo":"AANLkTimRKCYYQmgwY0DHu5+e-ggT8grJbdjWFvUqTzH=@mail.gmail.com","subject":"Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2010-09-03T18:23:23Z","receivedAt":"2010-09-03T18:23:23Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\n[added git ML to Cc:]\n\nOn Fri, Sep 03, 2010 at 07:18:43PM +0900, Magnus Damm wrote:\n> On Thu, Sep 2, 2010 at 10:39 PM, Jean-Christophe PLAGNIOL-VILLARD\n> <plagnioj@jcrosoft.com> wrote:\n> > factorise some generic infrastructure to assist looking up struct clks\n> > for the ARM & SH architecture.\n> >\n> > as the code is identical at 99%\n> >\n> > put the arch specific code for allocation as example in asm/clkdev.h\n> >\n> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>\n> > ---\n> > v3:\n> >        wrong comment removed\n> >        headers fixed\n> \n> [snip]\n> \n> I can't apply this patch using GNU patch. I've tested 2.5.9 and 2.6.1\n> from Gentoo.\n> \n> Using --dry-run is fine, but omitting dry-run gives me:\n> \n> ...\n> patching file arch/arm/common/clkdev.c\n> patching file arch/sh/include/asm/clkdev.h\n> Hunk #1 FAILED at 1.\n> Hunk #2 FAILED at 11.\n> 2 out of 2 hunks FAILED -- saving rejects to file\n> arch/sh/include/asm/clkdev.h.rej\n> \n> I guess this is caused by the last \"renaming\" hunk, see below.\n> \n> I thought these things were supposed to work out of the box...\nYes, they work out of the box, but only for people using git :-)\n\nMaybe git-apply can be used instead of patch?\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                           | Uwe Kleine-König            |\nIndustrial Linux Solutions                 | http://www.pengutronix.de/  |\n"},{"id":"149775","messageId":"20100903184351.GC2341@burratino","threadId":"24960","inReplyTo":"20100903182323.GA17152@pengutronix.de","subject":"[BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-03T18:43:51Z","receivedAt":"2010-09-03T18:43:51Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(+cc: bug-patch)\n\nHi,\n\nUwe Kleine-König wrote:\n> On Fri, Sep 03, 2010 at 07:18:43PM +0900, Magnus Damm wrote:\n\n>> Using --dry-run is fine, but omitting dry-run gives me:\n>> \n>> ...\n>> patching file arch/arm/common/clkdev.c\n>> patching file arch/sh/include/asm/clkdev.h\n>> Hunk #1 FAILED at 1.\n>> Hunk #2 FAILED at 11.\n>> 2 out of 2 hunks FAILED -- saving rejects to file\n>> arch/sh/include/asm/clkdev.h.rej\n>> \n>> I guess this is caused by the last \"renaming\" hunk, see below.\n\nYep, I can reproduce this.  Patch applies with \"git apply\",\n\"patch --dry-run -p1\" accepts it, \"patch -p1\" fails.\n\n $ patch --version | head -1\n GNU patch 2.6.1.85-423d\n $ cd ~/src/linux-2.6\n $ git checkout 2bfc96a12\n $ git clean -fd\n $ wget http://download.gmane.org/gmane.linux.ports.sh.devel/8747/8748\n $ patch -p1 --quiet --dry-run <8748 \n $ echo $?\n 0\n $ patch -p1 --quiet <8748 \n 2 out of 2 hunks FAILED -- saving rejects to file include/linux/clkdev.h.rej\n $ echo $?\n 1\n\nAndreas: ideas?\n"},{"id":"149779","messageId":"20100903192907.GA2978@n2100.arm.linux.org.uk","threadId":"24960","inReplyTo":"20100903184351.GC2341@burratino","subject":"Re: [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Russell King - ARM Linux","fromEmail":"linux@arm.linux.org.uk","sentAt":"2010-09-03T19:29:07Z","receivedAt":"2010-09-03T19:29:07Z","isPatch":true,"sender":{"key":"linux@arm.linux.org.uk","avatar":null},"body":"On Fri, Sep 03, 2010 at 01:43:51PM -0500, Jonathan Nieder wrote:\n> (+cc: bug-patch)\n> \n> Hi,\n> \n> Uwe Kleine-König wrote:\n> > On Fri, Sep 03, 2010 at 07:18:43PM +0900, Magnus Damm wrote:\n> \n> >> Using --dry-run is fine, but omitting dry-run gives me:\n> >> \n> >> ...\n> >> patching file arch/arm/common/clkdev.c\n> >> patching file arch/sh/include/asm/clkdev.h\n> >> Hunk #1 FAILED at 1.\n> >> Hunk #2 FAILED at 11.\n> >> 2 out of 2 hunks FAILED -- saving rejects to file\n> >> arch/sh/include/asm/clkdev.h.rej\n> >> \n> >> I guess this is caused by the last \"renaming\" hunk, see below.\n> \n> Yep, I can reproduce this.  Patch applies with \"git apply\",\n> \"patch --dry-run -p1\" accepts it, \"patch -p1\" fails.\n\ngit patches include additional metadata for renaming files, which gnu patch\nwill not understand.\n\nIf you want GNU patch compatible diffs, don't use -C or -M when generating\npatches out of git.\n"},{"id":"149780","messageId":"20100903193309.GC29821@pengutronix.de","threadId":"24960","inReplyTo":"20100903192907.GA2978@n2100.arm.linux.org.uk","subject":"Re: [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2010-09-03T19:33:09Z","receivedAt":"2010-09-03T19:33:09Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hey Russell,\n\nOn Fri, Sep 03, 2010 at 08:29:07PM +0100, Russell King - ARM Linux wrote:\n> On Fri, Sep 03, 2010 at 01:43:51PM -0500, Jonathan Nieder wrote:\n> > Uwe Kleine-König wrote:\n> > > On Fri, Sep 03, 2010 at 07:18:43PM +0900, Magnus Damm wrote:\n> > \n> > >> Using --dry-run is fine, but omitting dry-run gives me:\n> > >> \n> > >> ...\n> > >> patching file arch/arm/common/clkdev.c\n> > >> patching file arch/sh/include/asm/clkdev.h\n> > >> Hunk #1 FAILED at 1.\n> > >> Hunk #2 FAILED at 11.\n> > >> 2 out of 2 hunks FAILED -- saving rejects to file\n> > >> arch/sh/include/asm/clkdev.h.rej\n> > >> \n> > >> I guess this is caused by the last \"renaming\" hunk, see below.\n> > \n> > Yep, I can reproduce this.  Patch applies with \"git apply\",\n> > \"patch --dry-run -p1\" accepts it, \"patch -p1\" fails.\n> \n> git patches include additional metadata for renaming files, which gnu patch\n> will not understand.\n> \n> If you want GNU patch compatible diffs, don't use -C or -M when generating\n> patches out of git.\nStill GNU patch should then already fail in --dry-run mode.\n \nBest regards\nUwe\n\n-- \nPengutronix e.K.                           | Uwe Kleine-König            |\nIndustrial Linux Solutions                 | http://www.pengutronix.de/  |\n"},{"id":"149781","messageId":"vpqr5habp05.fsf@bauges.imag.fr","threadId":"24960","inReplyTo":"20100903192907.GA2978@n2100.arm.linux.org.uk","subject":"Re: [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-09-03T19:34:02Z","receivedAt":"2010-09-03T19:34:02Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Russell King - ARM Linux <linux@arm.linux.org.uk> writes:\n\n> git patches include additional metadata for renaming files, which gnu patch\n> will not understand.\n>\n> If you want GNU patch compatible diffs, don't use -C or -M when generating\n> patches out of git.\n\nFyi: actually, GNU patch will support git-style patches in the next\nversion according to\n\nhttp://savannah.gnu.org/forum/forum.php?forum_id=6320\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"149783","messageId":"m2r5ha7gri.fsf@igel.home","threadId":"24960","inReplyTo":"20100903193309.GC29821@pengutronix.de","subject":"Re: [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2010-09-03T19:45:37Z","receivedAt":"2010-09-03T19:45:37Z","isPatch":true,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:\n\n> Still GNU patch should then already fail in --dry-run mode.\n\nSince --dry-run doesn't actually perform any changes it can easily be\nfooled when a file is patched twice.\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"},{"id":"149795","messageId":"201009040058.18028.agruen@suse.de","threadId":"24960","inReplyTo":"20100903184351.GC2341@burratino","subject":"Re: [bug-patch] [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Andreas Gruenbacher","fromEmail":"agruen@suse.de","sentAt":"2010-09-03T22:58:17Z","receivedAt":"2010-09-03T22:58:17Z","isPatch":true,"sender":{"key":"agruen@suse.de","avatar":null},"body":"Hi,\n\nOn Friday 03 September 2010 20:43:51 Jonathan Nieder wrote:\n> Uwe Kleine-König wrote:\n> > On Fri, Sep 03, 2010 at 07:18:43PM +0900, Magnus Damm wrote:\n> \n> >> Using --dry-run is fine, but omitting dry-run gives me:\n> >> \n> >> ...\n> >> patching file arch/arm/common/clkdev.c\n> >> patching file arch/sh/include/asm/clkdev.h\n> >> Hunk #1 FAILED at 1.\n> >> Hunk #2 FAILED at 11.\n> >> 2 out of 2 hunks FAILED -- saving rejects to file\n> >> arch/sh/include/asm/clkdev.h.rej\n> >> \n> >> I guess this is caused by the last \"renaming\" hunk, see below.\n> \n> Yep, I can reproduce this.  Patch applies with \"git apply\",\n> \"patch --dry-run -p1\" accepts it, \"patch -p1\" fails.\n> \n>  $ patch --version | head -1\n>  GNU patch 2.6.1.85-423d\n>  $ cd ~/src/linux-2.6\n>  $ git checkout 2bfc96a12\n>  $ git clean -fd\n>  $ wget http://download.gmane.org/gmane.linux.ports.sh.devel/8747/8748\n> [...]\n\nsomething pretty bizarre is going on here.  The wget output modifies the same \nfile twice, but both patches to this file have the same source sha1 (5645f35):\n\n> diff --git a/arch/sh/include/asm/clkdev.h b/arch/sh/include/asm/clkdev.h\n> dissimilarity index 69%\n> index 5645f35..6ba9186 100644\n> --- a/arch/sh/include/asm/clkdev.h\n> +++ b/arch/sh/include/asm/clkdev.h\n\n> diff --git a/arch/sh/include/asm/clkdev.h b/include/linux/clkdev.h\n> similarity index 85%\n> rename from arch/sh/include/asm/clkdev.h\n> rename to include/linux/clkdev.h\n> index 5645f35..457bcb0 100644\n\nSo \"git apply\" and \"patch --dry-run\" seem to work only by accident.\n\nHow was this patch generated: with git itself?\n\nThe fact that \"patch --dry-run\" may not work for patches that modify the same \nfile twice is a known defect.  I don't know how to solve this in a reasonably \nelegant way.  Luckily the problem only triggers when people are doing \nsomething \"strange\" such as concatenating patches.\n\nAndreas\n"},{"id":"149800","messageId":"20100903233252.GD30310@burratino","threadId":"24960","inReplyTo":"201009040058.18028.agruen@suse.de","subject":"Re: [bug-patch] [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-03T23:32:52Z","receivedAt":"2010-09-03T23:32:52Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Andreas Gruenbacher wrote:\n\n> something pretty bizarre is going on here.  The wget output modifies the same \n> file twice, but both patches to this file have the same source sha1 (5645f35):\n\n>From the git v1.6.0-rc0~92 changelog entry:\n\n    apply: fix copy/rename breakage\n    \n    7ebd52a (Merge branch 'dz/apply-again', 2008-07-01) taught \"git-apply\" to\n    grok a (non-git) patch that is a concatenation of separate patches that\n    touch the same file number of times, by recording the postimage of patch\n    application of previous round and using it as the preimage for later\n    rounds.\n    \n    This \"incremental\" mode of patch application fundamentally contradicts\n    with the way git rename/copy patches are designed.  When a git patch talks\n    about a file A getting modified, and a new file B created out of A, like\n    this:\n    \n        diff --git a/A b/A\n        --- a/A\n        +++ b/A\n        ... change text here ...\n        diff --git a/A b/B\n        copy from A\n        copy to B\n        --- a/A\n        +++ b/B\n        ... change text here ...\n    \n    the second change to produce B does not depend on what is done to A with\n    the first change in any way.  This is explicitly done so for reviewability\n    of individual patches.\n    \n    With this commit, we do not look at 'fn_table' that records the postimage\n    of previous round when applying a patch to produce a new file out of an\n    existing file.\n\n> How was this patch generated: with git itself?\n\nYes, the patch basically agrees with what I get by applying it and running\n\n git format-patch -M -B HEAD^..HEAD\n"},{"id":"149803","messageId":"20100904000348.GA7498@n2100.arm.linux.org.uk","threadId":"24960","inReplyTo":"20100903193309.GC29821@pengutronix.de","subject":"Re: [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Russell King - ARM Linux","fromEmail":"linux@arm.linux.org.uk","sentAt":"2010-09-04T00:03:48Z","receivedAt":"2010-09-04T00:03:48Z","isPatch":true,"sender":{"key":"linux@arm.linux.org.uk","avatar":null},"body":"On Fri, Sep 03, 2010 at 09:33:09PM +0200, Uwe Kleine-König wrote:\n> > git patches include additional metadata for renaming files, which gnu patch\n> > will not understand.\n> > \n> > If you want GNU patch compatible diffs, don't use -C or -M when generating\n> > patches out of git.\n> Still GNU patch should then already fail in --dry-run mode.\n\nAnd now look at the patch - it touches arch/sh/include/asm/clkdev.h twice.\nOnce to remove it and once as a rename.\n\nGNU patch not in --dry-run mode will first remove arch/sh/include/asm/clkdev.h,\nand then not have a file to deal with when it tries to patch the rename\npart.  Whereas with --dry-run, the file stays around.\n\nAs I say, it's because GNU patch doesn't (currently) understand GIT\npatches.  I wouldn't call that a bug in GNU patch.\n"},{"id":"149813","messageId":"20100904032117.GL17702@game.jcrosoft.org","threadId":"24960","inReplyTo":"201009040058.18028.agruen@suse.de","subject":"Re: [bug-patch] [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Jean-Christophe PLAGNIOL-VILLARD","fromEmail":"plagnioj@jcrosoft.com","sentAt":"2010-09-04T03:21:17Z","receivedAt":"2010-09-04T03:21:17Z","isPatch":true,"sender":{"key":"plagnioj@jcrosoft.com","avatar":null},"body":"> \n> So \"git apply\" and \"patch --dry-run\" seem to work only by accident.\n> \n> How was this patch generated: with git itself?\nI did as usual\ngit format-patch -M -B -C HEAD~\n> \n> The fact that \"patch --dry-run\" may not work for patches that modify the same \n> file twice is a known defect.  I don't know how to solve this in a reasonably \n> elegant way.  Luckily the problem only triggers when people are doing \n> something \"strange\" such as concatenating patches.\n\nBest Regards,\nJ.\n"},{"id":"149875","messageId":"201009042333.51419.agruen@suse.de","threadId":"24960","inReplyTo":"20100904000348.GA7498@n2100.arm.linux.org.uk","subject":"Re: [bug-patch] Re: [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Andreas Gruenbacher","fromEmail":"agruen@suse.de","sentAt":"2010-09-04T21:33:51Z","receivedAt":"2010-09-04T21:33:51Z","isPatch":true,"sender":{"key":"agruen@suse.de","avatar":null},"body":"On Saturday 04 September 2010 02:03:48 Russell King - ARM Linux wrote:\n> As I say, it's because GNU patch doesn't (currently) understand GIT\n> patches.  I wouldn't call that a bug in GNU patch.\n\nGNU patch in the version used does understand GIT patch headers and does \nsupport things like renames.\n\nThe --dry-run option often will not work when the same file is modified more \nthan once in the same patch, though.  This is because GNU patch doesn't \nremember the intermediary states of files.\n\nIn this case, the patch itself is broken.\n\nAndreas\n"},{"id":"149876","messageId":"20100904214527.GA20444@n2100.arm.linux.org.uk","threadId":"24960","inReplyTo":"201009042333.51419.agruen@suse.de","subject":"Re: [bug-patch] Re: [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Russell King - ARM Linux","fromEmail":"linux@arm.linux.org.uk","sentAt":"2010-09-04T21:45:27Z","receivedAt":"2010-09-04T21:45:27Z","isPatch":true,"sender":{"key":"linux@arm.linux.org.uk","avatar":null},"body":"On Sat, Sep 04, 2010 at 11:33:51PM +0200, Andreas Gruenbacher wrote:\n> On Saturday 04 September 2010 02:03:48 Russell King - ARM Linux wrote:\n> > As I say, it's because GNU patch doesn't (currently) understand GIT\n> > patches.  I wouldn't call that a bug in GNU patch.\n> \n> GNU patch in the version used does understand GIT patch headers and does \n> support things like renames.\n> \n> The --dry-run option often will not work when the same file is modified more \n> than once in the same patch, though.  This is because GNU patch doesn't \n> remember the intermediary states of files.\n> \n> In this case, the patch itself is broken.\n\nGIT has many options to control how it produces patches, and -C or -M\nallow it to reduce the size of patches making them more reviewable.  It\nalso makes them incompatible with GNU patch, whether or not GNU patch\nunderstands the GIT headers.\n\nAs I've already said - if you want GNU compatible patches, don't generate\nGIT patches using -C or -M.\n\nSimples.\n"},{"id":"149877","messageId":"201009042346.11787.agruen@suse.de","threadId":"24960","inReplyTo":"20100904214527.GA20444@n2100.arm.linux.org.uk","subject":"Re: [bug-patch] Re: [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Andreas Gruenbacher","fromEmail":"agruen@suse.de","sentAt":"2010-09-04T21:46:11Z","receivedAt":"2010-09-04T21:46:11Z","isPatch":true,"sender":{"key":"agruen@suse.de","avatar":null},"body":"On Saturday 04 September 2010 23:45:27 Russell King - ARM Linux wrote:\n> It also makes them incompatible with GNU patch, whether or not GNU patch\n> understands the GIT headers.\n\nAha?  Then why do you think GNU patch tries to understand the GIt patch \nheaders?  So that it can be incompatible with GIT?\n\nAndreas\n"},{"id":"149880","messageId":"201009042357.34237.agruen@suse.de","threadId":"24960","inReplyTo":"20100903233252.GD30310@burratino","subject":"Re: [bug-patch] [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Andreas Gruenbacher","fromEmail":"agruen@suse.de","sentAt":"2010-09-04T21:57:34Z","receivedAt":"2010-09-04T21:57:34Z","isPatch":true,"sender":{"key":"agruen@suse.de","avatar":null},"body":"On Saturday 04 September 2010 01:32:52 Jonathan Nieder wrote:\n> Andreas Gruenbacher wrote:\n> \n> > something pretty bizarre is going on here.  The wget output modifies the same \n> > file twice, but both patches to this file have the same source sha1 (5645f35):\n> \n> From the git v1.6.0-rc0~92 changelog entry:\n> \n>     apply: fix copy/rename breakage\n>     \n>     7ebd52a (Merge branch 'dz/apply-again', 2008-07-01) taught \"git-apply\" to\n>     grok a (non-git) patch that is a concatenation of separate patches that\n>     touch the same file number of times, by recording the postimage of patch\n>     application of previous round and using it as the preimage for later\n>     rounds.\n>     \n>     This \"incremental\" mode of patch application fundamentally contradicts\n>     with the way git rename/copy patches are designed.  When a git patch talks\n>     about a file A getting modified, and a new file B created out of A, like\n>     this:\n>     \n>         diff --git a/A b/A\n>         --- a/A\n>         +++ b/A\n>         ... change text here ...\n>         diff --git a/A b/B\n>         copy from A\n>         copy to B\n>         --- a/A\n>         +++ b/B\n>         ... change text here ...\n>     \n>     the second change to produce B does not depend on what is done to A with\n>     the first change in any way.  This is explicitly done so for reviewability\n>     of individual patches.\n>     \n>     With this commit, we do not look at 'fn_table' that records the postimage\n>     of previous round when applying a patch to produce a new file out of an\n>     existing file.\n\nOuch ... this gets really messy when a user concatenates git style patches\nand they are not applied to exactly the same source tree.\n\nThanks for digging out this commit message!\n\nAndreas\n"},{"id":"149879","messageId":"20100904220152.GB20444@n2100.arm.linux.org.uk","threadId":"24960","inReplyTo":"201009042346.11787.agruen@suse.de","subject":"Re: [bug-patch] Re: [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Russell King - ARM Linux","fromEmail":"linux@arm.linux.org.uk","sentAt":"2010-09-04T22:01:52Z","receivedAt":"2010-09-04T22:01:52Z","isPatch":true,"sender":{"key":"linux@arm.linux.org.uk","avatar":null},"body":"On Sat, Sep 04, 2010 at 11:46:11PM +0200, Andreas Gruenbacher wrote:\n> On Saturday 04 September 2010 23:45:27 Russell King - ARM Linux wrote:\n> > It also makes them incompatible with GNU patch, whether or not GNU patch\n> > understands the GIT headers.\n> \n> Aha?  Then why do you think GNU patch tries to understand the GIt patch \n> headers?  So that it can be incompatible with GIT?\n\nRead what you said last time around.  \"In this case, the patch itself is\nbroken.\"\n\nSo, because GNU patch doesn't understand the patch file, the patch file\nmust be broken?  No, the patch file is fine with GIT which can apply it\ncorrectly, but incompatible with GNU patch because of the way GNU patch\nworks (as you yourself said, GNU patch doesn't keep the intermediate\nstates.)\n\nI repeat - if you want maximum compatibility, want GNU patch to be able\nto apply the patch with or without --dry-run, then don't use -C or -M\nwhen generating patches with git.\n\nSimples.\n"},{"id":"149893","messageId":"201009050026.08235.agruen@suse.de","threadId":"24960","inReplyTo":"20100904220152.GB20444@n2100.arm.linux.org.uk","subject":"Re: [bug-patch] Re: [BUG?] rename patch accepted with --dry-run, rejected without (Re: [PATCH V3] arm & sh: factorised duplicated clkdev.c)","fromName":"Andreas Gruenbacher","fromEmail":"agruen@suse.de","sentAt":"2010-09-04T22:26:08Z","receivedAt":"2010-09-04T22:26:08Z","isPatch":true,"sender":{"key":"agruen@suse.de","avatar":null},"body":"On Sunday 05 September 2010 00:01:52 Russell King - ARM Linux wrote:\n> On Sat, Sep 04, 2010 at 11:46:11PM +0200, Andreas Gruenbacher wrote:\n> > On Saturday 04 September 2010 23:45:27 Russell King - ARM Linux wrote:\n> > > It also makes them incompatible with GNU patch, whether or not GNU patch\n> > > understands the GIT headers.\n> > \n> > Aha?  Then why do you think GNU patch tries to understand the GIt patch \n> > headers?  So that it can be incompatible with GIT?\n> \n> Read what you said last time around.  \"In this case, the patch itself is\n> broken.\"\n\nI was corrected on that by Jonathan Nieder's mail which describes a detail of \nthe GIT patch format that I didn't know about.  So it's a bug in the way GNU \npatch handles the git patch format and not an error in the patch.  Not nice \nand probably not easy to fix, but not fundamentally unfixable.\n\nAndreas\n"}]}