{"thread":{"id":"17203","subject":"[PATCH/RFC] git-am: Make it easier to see which patch failed","startedAt":"2009-01-16T13:18:39Z","lastAt":"2009-01-19T03:38:06Z","messageCount":15,"participants":["Jonas Flodén","Johannes Schindelin","Junio C Hamano","Stephan Beyer","Jeff King","Thomas Rast"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"100734","messageId":"636ecac0901160518o16706bbia9acaf09fdf92946@mail.gmail.com","threadId":"17203","inReplyTo":null,"subject":"[PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Jonas Flodén","fromEmail":"jonas@floden.nu","sentAt":"2009-01-16T13:18:39Z","receivedAt":"2009-01-16T13:18:39Z","isPatch":true,"sender":{"key":"jonas@floden.nu","avatar":null},"body":"When git-am fails it's not always easy to see which patch failed,\nsince it's often hidden by a lot of error messages.\nAdd an extra line which prints the name of the failed patch just\nbefore the resolve message to make it easier to find.\n\nSigned-off-by: Jonas Flodén <jonas@floden.nu>\n---\n\nThis is something I have thought about for a long time.\nI always wonder why git rebase couldn't print the patch\nname when it failed... Finally I took the time to fix it.\nPlease feel free to comment. It's my first Git patch...\n\nWith regards,\nJonas\n\n git-am.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 4b157fe..5d72a66 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -502,6 +502,7 @@ do\n \tif test $apply_status != 0\n \tthen\n \t\techo Patch failed at $msgnum.\n+\t\tprintf '\\nFailed to apply: %s\\n' \"$FIRSTLINE\"\n \t\tstop_here_user_resolve $this\n \tfi\n\n-- \n1.6.1.28.gc32f76\n"},{"id":"100740","messageId":"alpine.DEB.1.00.0901161513400.3586@pacific.mpi-cbg.de","threadId":"17203","inReplyTo":"636ecac0901160518o16706bbia9acaf09fdf92946@mail.gmail.com","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-16T14:14:18Z","receivedAt":"2009-01-16T14:14:18Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 16 Jan 2009, Jonas Flodén wrote:\n\n>  \tthen\n>  \t\techo Patch failed at $msgnum.\n> +\t\tprintf '\\nFailed to apply: %s\\n' \"$FIRSTLINE\"\n>  \t\tstop_here_user_resolve $this\n\nMaybe\n\n-  \t\techo Patch failed at $msgnum.\n+  \t\techo Patch failed at $msgnum($FIRSTLINE).\n\nHmm?\n\nCiao,\nDscho\n"},{"id":"100742","messageId":"636ecac0901160634r586c72a0r9bb63c6f019f5bff@mail.gmail.com","threadId":"17203","inReplyTo":"alpine.DEB.1.00.0901161513400.3586@pacific.mpi-cbg.de","subject":"[PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Jonas Flodén","fromEmail":"jonas@floden.nu","sentAt":"2009-01-16T14:34:47Z","receivedAt":"2009-01-16T14:34:47Z","isPatch":true,"sender":{"key":"jonas@floden.nu","avatar":null},"body":"When git-am fails it's not always easy to see which patch failed,\nsince it's often hidden by a lot of error messages.\nAdd an extra line which prints the name of the failed patch just\nbefore the resolve message to make it easier to find.\n\nSigned-off-by: Jonas Flodén <jonas@floden.nu>\n---\nJohannes Schindelin wrote:\n> Maybe\n>\n> -               echo Patch failed at $msgnum.\n> +               echo Patch failed at $msgnum($FIRSTLINE).\n\nHow about this instead. Though the line could get very long.\nThis makes the line stand out a little more.\n\n git-am.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 4b157fe..09c2f9c 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -501,7 +501,7 @@ do\n \tfi\n \tif test $apply_status != 0\n \tthen\n-\t\techo Patch failed at $msgnum.\n+\t\tprintf '\\nPatch failed at %s (%s)\\n' \"$msgnum\" \"$FIRSTLINE\"\n \t\tstop_here_user_resolve $this\n \tfi\n\n-- \n1.6.1.28.gc32f76\n"},{"id":"100750","messageId":"alpine.DEB.1.00.0901161726440.3586@pacific.mpi-cbg.de","threadId":"17203","inReplyTo":"636ecac0901160634r586c72a0r9bb63c6f019f5bff@mail.gmail.com","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-16T16:27:00Z","receivedAt":"2009-01-16T16:27:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 16 Jan 2009, Jonas Flodén wrote:\n\n> Johannes Schindelin wrote:\n> > Maybe\n> >\n> > -               echo Patch failed at $msgnum.\n> > +               echo Patch failed at $msgnum($FIRSTLINE).\n> \n> How about this instead. Though the line could get very long.\n> This makes the line stand out a little more.\n\nFine by me!\n\nCiao,\nDscho"},{"id":"100918","messageId":"7vhc3x1874.fsf@gitster.siamese.dyndns.org","threadId":"17203","inReplyTo":"636ecac0901160634r586c72a0r9bb63c6f019f5bff@mail.gmail.com","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-18T05:42:23Z","receivedAt":"2009-01-18T05:42:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Jonas Flodén\" <jonas@floden.nu> writes:\n\n> When git-am fails it's not always easy to see which patch failed,\n> since it's often hidden by a lot of error messages.\n> Add an extra line which prints the name of the failed patch just\n> before the resolve message to make it easier to find.\n>\n> Signed-off-by: Jonas Flodén <jonas@floden.nu>\n> ---\n> Johannes Schindelin wrote:\n>> Maybe\n>>\n>> -               echo Patch failed at $msgnum.\n>> +               echo Patch failed at $msgnum($FIRSTLINE).\n>\n> How about this instead. Though the line could get very long.\n> This makes the line stand out a little more.\n>\n>  git-am.sh |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/git-am.sh b/git-am.sh\n> index 4b157fe..09c2f9c 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n> @@ -501,7 +501,7 @@ do\n>  \tfi\n>  \tif test $apply_status != 0\n>  \tthen\n> -\t\techo Patch failed at $msgnum.\n> +\t\tprintf '\\nPatch failed at %s (%s)\\n' \"$msgnum\" \"$FIRSTLINE\"\n>  \t\tstop_here_user_resolve $this\n>  \tfi\n\nLooks sane except that I do not think you need printf nor the leading\nblank line, i.e.\n\n\techo \"Patch failed at $msgnum ($FIRSTLINE)\"\n"},{"id":"100941","messageId":"20090118094113.GE11992@leksak.fem-net","threadId":"17203","inReplyTo":"7vhc3x1874.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2009-01-18T09:41:13Z","receivedAt":"2009-01-18T09:41:13Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"> > diff --git a/git-am.sh b/git-am.sh\n> > index 4b157fe..09c2f9c 100755\n> > --- a/git-am.sh\n> > +++ b/git-am.sh\n> > @@ -501,7 +501,7 @@ do\n> >  \tfi\n> >  \tif test $apply_status != 0\n> >  \tthen\n> > -\t\techo Patch failed at $msgnum.\n> > +\t\tprintf '\\nPatch failed at %s (%s)\\n' \"$msgnum\" \"$FIRSTLINE\"\n> >  \t\tstop_here_user_resolve $this\n> >  \tfi\n> \n> Looks sane except that I do not think you need printf nor the leading\n> blank line, i.e.\n> \n> \techo \"Patch failed at $msgnum ($FIRSTLINE)\"\n\nHmm, IIRC if $FIRSTLINE contains \\n or something like that, it will\ninterpret this as newline in some shell/echo implementations.\n\nSo printf \"...%s...\" \"$FOO\" is always sane for user input.\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"100942","messageId":"20090118095350.GF11992@leksak.fem-net","threadId":"17203","inReplyTo":"20090118094113.GE11992@leksak.fem-net","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2009-01-18T09:53:50Z","receivedAt":"2009-01-18T09:53:50Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Stephan Beyer wrote:\n> Hmm, IIRC if $FIRSTLINE contains \\n or something like that, it will\n> interpret this as newline in some shell/echo implementations.\n\nJust in case someone wonders but doesn't dare ask:\n\nbash as expected:\n\t$ echo 'foo\\nbar'\n\tfoo\\nbar\n\t$ echo -e 'foo\\nbar'\n\tfoo\n\tbar\n\nBut dash:\n\t$ echo 'foo\\nbar'\n\tfoo\n\tbar\n\t$ echo -e 'foo\\nbar'\n\t-e foo\n\tbar\n\n(According to Debian Popularity Contest[1] \"dash\" is used in more than\n10.000 Debian installations, although it doesn't say if it is used for\n/bin/sh.)\n\n 1. http://qa.debian.org/popcon.php?package=dash\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"101005","messageId":"20090118153928.GA16664@coredump.intra.peff.net","threadId":"17203","inReplyTo":"20090118094113.GE11992@leksak.fem-net","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-01-18T15:39:29Z","receivedAt":"2009-01-18T15:39:29Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jan 18, 2009 at 10:41:13AM +0100, Stephan Beyer wrote:\n\n> > Looks sane except that I do not think you need printf nor the leading\n> > blank line, i.e.\n> > \n> > \techo \"Patch failed at $msgnum ($FIRSTLINE)\"\n> \n> Hmm, IIRC if $FIRSTLINE contains \\n or something like that, it will\n> interpret this as newline in some shell/echo implementations.\n> \n> So printf \"...%s...\" \"$FOO\" is always sane for user input.\n\nYes, I'm surprised Junio doesn't remember the mass conversions we already had\nto do (4b7cc26a and 293623ed). But looking at the date, I guess it _has_\nbeen a year and a half. :)\n\n-Peff\n"},{"id":"101014","messageId":"alpine.DEB.1.00.0901181711090.3586@pacific.mpi-cbg.de","threadId":"17203","inReplyTo":"20090118153928.GA16664@coredump.intra.peff.net","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-18T16:17:43Z","receivedAt":"2009-01-18T16:17:43Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 18 Jan 2009, Jeff King wrote:\n\n> On Sun, Jan 18, 2009 at 10:41:13AM +0100, Stephan Beyer wrote:\n> \n> > > Looks sane except that I do not think you need printf nor the leading\n> > > blank line, i.e.\n> > > \n> > > \techo \"Patch failed at $msgnum ($FIRSTLINE)\"\n> > \n> > Hmm, IIRC if $FIRSTLINE contains \\n or something like that, it will\n> > interpret this as newline in some shell/echo implementations.\n> > \n> > So printf \"...%s...\" \"$FOO\" is always sane for user input.\n> \n> Yes, I'm surprised Junio doesn't remember the mass conversions we \n> already had to do (4b7cc26a and 293623ed). But looking at the date, I \n> guess it _has_ been a year and a half. :)\n\nHey, be nice to Junio.  Have you seen the amount of mails on this list \nrecently?  I think Junio's the only one really reading all of them; even \nif you were right, he would be entitled to a nicer reminder.\n\nBut you are wrong.  And Stephan is wrong, too.\n\nThe name \"FIRSTLINE\" suggests that it is indeed a first line, and \nconsequently cannot contain a newline.\n\nAnd indeed, it is defined as\n\n\tFIRSTLINE=$(sed 1q \"$dotest/final-commit\")\n\nJust do the following in any of your favorite shells:\n\n\t$ FIRSTLINE=$(sed 1q README)\n\t$ echo \"$FIRSTLINE.\"\n\nYou'll find that the \".\" is not in a new line.\n\nAnd I know that we relied on that behavior for an eternity.\n\nSo there is certainly no need for a printf here.\n\n'nuff said,\nDscho\n"},{"id":"101017","messageId":"200901181749.52896.trast@student.ethz.ch","threadId":"17203","inReplyTo":"alpine.DEB.1.00.0901181711090.3586@pacific.mpi-cbg.de","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-01-18T16:49:51Z","receivedAt":"2009-01-18T16:49:51Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Johannes Schindelin wrote:\n> On Sun, 18 Jan 2009, Jeff King wrote:\n> > On Sun, Jan 18, 2009 at 10:41:13AM +0100, Stephan Beyer wrote:\n> > > Hmm, IIRC if $FIRSTLINE contains \\n or something like that, it will\n> > > interpret this as newline in some shell/echo implementations.\n> > > \n> > > So printf \"...%s...\" \"$FOO\" is always sane for user input.\n> \n> But you are wrong.  And Stephan is wrong, too.\n> \n> The name \"FIRSTLINE\" suggests that it is indeed a first line, and \n> consequently cannot contain a newline.\n\nI think the point was that $FIRSTLINE can contain a backslash sequence\nsuch as (literally) \\n or \\r.  Indeed 'man 1p echo' on my system says\n\n  _string_  A string to be written to standard output. If the first\n            operand is -n, or if any of the operands contain a\n            backslash ( '\\' ) character, the results are\n            implementation- defined.\n\n(Those POSIX manpages are really useful!)\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"101018","messageId":"20090118165326.GM11992@leksak.fem-net","threadId":"17203","inReplyTo":"alpine.DEB.1.00.0901181711090.3586@pacific.mpi-cbg.de","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2009-01-18T16:53:26Z","receivedAt":"2009-01-18T16:53:26Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nJohannes Schindelin wrote:\n> On Sun, 18 Jan 2009, Jeff King wrote:\n> \n> > On Sun, Jan 18, 2009 at 10:41:13AM +0100, Stephan Beyer wrote:\n> > \n> > > > Looks sane except that I do not think you need printf nor the leading\n> > > > blank line, i.e.\n> > > > \n> > > > \techo \"Patch failed at $msgnum ($FIRSTLINE)\"\n> > > \n> > > Hmm, IIRC if $FIRSTLINE contains \\n or something like that, it will\n> > > interpret this as newline in some shell/echo implementations.\n> > > \n> > > So printf \"...%s...\" \"$FOO\" is always sane for user input.\n> > \n> > Yes, I'm surprised Junio doesn't remember the mass conversions we \n> > already had to do (4b7cc26a and 293623ed). But looking at the date, I \n> > guess it _has_ been a year and a half. :)\n> \n> Hey, be nice to Junio.  Have you seen the amount of mails on this list \n> recently?  I think Junio's the only one really reading all of them; even \n> if you were right, he would be entitled to a nicer reminder.\n\nI had almost written the same text but then I thought Jeff did not mean\nit bad, he was just surprised.\n\n> But you are wrong.  And Stephan is wrong, too.\n> \n> The name \"FIRSTLINE\" suggests that it is indeed a first line, and \n> consequently cannot contain a newline.\n> \n> And indeed, it is defined as\n> \n> \tFIRSTLINE=$(sed 1q \"$dotest/final-commit\")\n> \n> Just do the following in any of your favorite shells:\n> \n> \t$ FIRSTLINE=$(sed 1q README)\n> \t$ echo \"$FIRSTLINE.\"\n> \n> You'll find that the \".\" is not in a new line.\n\nI have to disagree:\n\n\t$ cat newline\n\tfoo\\nbar\n\t$ FIRSTLINE=$(sed 1q newline)\n\t$ echo \"$FIRSTLINE.\"\n\tfoo\n\tbar.\n\t$ exit\n\n> And I know that we relied on that behavior for an eternity.\n\nWhere?  We should perhaps fix it then.\n\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"101020","messageId":"20090118170711.GA17055@coredump.intra.peff.net","threadId":"17203","inReplyTo":"alpine.DEB.1.00.0901181711090.3586@pacific.mpi-cbg.de","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-01-18T17:07:11Z","receivedAt":"2009-01-18T17:07:11Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jan 18, 2009 at 05:17:43PM +0100, Johannes Schindelin wrote:\n\n> > Yes, I'm surprised Junio doesn't remember the mass conversions we \n> > already had to do (4b7cc26a and 293623ed). But looking at the date, I \n> > guess it _has_ been a year and a half. :)\n> \n> Hey, be nice to Junio.  Have you seen the amount of mails on this list \n> recently?  I think Junio's the only one really reading all of them; even \n> if you were right, he would be entitled to a nicer reminder.\n\nI didn't mean to be mean. On the contrary, I was surprised because _he_\nusually is the one reminding _me_ about such fixes. I guess Junio is\nhuman, after all. :)\n\n> But you are wrong.  And Stephan is wrong, too.\n> \n> The name \"FIRSTLINE\" suggests that it is indeed a first line, and \n> consequently cannot contain a newline.\n\nIt is not \"this is a problem because it might contain a newline\" but \"this\nis a problem because it might contain an escape sequence, _an example_\nof which is a \\n newline.\" So the question is whether you can guarantee\nthat $FIRSTLINE does not contain a backslash. Which I don't think is the\ncase here.\n\n-Peff\n"},{"id":"101027","messageId":"alpine.DEB.1.00.0901181843230.3586@pacific.mpi-cbg.de","threadId":"17203","inReplyTo":"20090118170711.GA17055@coredump.intra.peff.net","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-18T17:44:01Z","receivedAt":"2009-01-18T17:44:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi.\n\nOn Sun, 18 Jan 2009, Jeff King wrote:\n\n> On Sun, Jan 18, 2009 at 05:17:43PM +0100, Johannes Schindelin wrote:\n> \n> > The name \"FIRSTLINE\" suggests that it is indeed a first line, and \n> > consequently cannot contain a newline.\n> \n> It is not \"this is a problem because it might contain a newline\" but \n> \"this is a problem because it might contain an escape sequence, _an \n> example_ of which is a \\n newline.\" So the question is whether you can \n> guarantee that $FIRSTLINE does not contain a backslash. Which I don't \n> think is the case here.\n\nOh.  Okay, so I was wrong.  But only because dash's echo behaves in a \nstrange way: it makes \"-e\" a noop?\n\nCiao,\nDscho\n"},{"id":"101031","messageId":"20090118174941.GA22718@coredump.intra.peff.net","threadId":"17203","inReplyTo":"alpine.DEB.1.00.0901181843230.3586@pacific.mpi-cbg.de","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-01-18T17:49:41Z","receivedAt":"2009-01-18T17:49:41Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jan 18, 2009 at 06:44:01PM +0100, Johannes Schindelin wrote:\n\n> Oh.  Okay, so I was wrong.  But only because dash's echo behaves in a \n> strange way: it makes \"-e\" a noop?\n\nRight. \"-e\" isn't in POSIX at all, and it is a SysV-ism to allow escapes\nin any argument (I don't know if \"-e\" was introduced by GNU people, or\ncame from elsewhere).\n\nSee here for the gory details:\n\n  http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html\n\n-Peff\n"},{"id":"101089","messageId":"7vr630rmn5.fsf@gitster.siamese.dyndns.org","threadId":"17203","inReplyTo":"20090118153928.GA16664@coredump.intra.peff.net","subject":"Re: [PATCH/RFC] git-am: Make it easier to see which patch failed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-19T03:38:06Z","receivedAt":"2009-01-19T03:38:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Yes, I'm surprised Junio doesn't remember the mass conversions we already had\n> to do (4b7cc26a and 293623ed). But looking at the date, I guess it _has_\n> been a year and a half. :)\n\nOk, I forgot, sue me ;-).\n\nAnyway, thanks for spotting.  I'll fix it up like this.\n\n-- >8 --\nSubject: git-am: re-fix the diag message printing\n\nThe $FIRSTLINE variable is from the user's commit and can contain\narbitrary backslash escapes that may be (mis)interpreted when given to\n\"echo\", depending on the implementation.  Use \"printf\" to work around the\nissue.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-am.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex ae2fe56..cf3d4a7 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -501,7 +501,7 @@ do\n \tfi\n \tif test $apply_status != 0\n \tthen\n-\t\techo \"Patch failed at $msgnum $FIRSTLINE\"\n+\t\tprintf 'Patch failed at %s %s\\n' \"$msgnum\" \"$FIRSTLINE\"\n \t\tstop_here_user_resolve $this\n \tfi\n \n-- \n1.6.1.245.gdd9f9\n"}]}