{"thread":{"id":"29834","subject":"Bug: pull --rebase with é in name","startedAt":"2012-03-05T09:59:16Z","lastAt":"2012-03-06T18:31:12Z","messageCount":17,"participants":["René Haber","Jeff King","Thomas Rast","Jakub Narebski","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"186093","messageId":"FECFDD4D-6EC3-4DE1-8A08-B4477345C4AA@habr.de","threadId":"29834","inReplyTo":null,"subject":"Bug: pull --rebase with é in name","fromName":"René Haber","fromEmail":"rene@habr.de","sentAt":"2012-03-05T09:59:16Z","receivedAt":"2012-03-05T09:59:16Z","isPatch":false,"sender":{"key":"rene@habr.de","avatar":null},"body":"Hello,\n\nI'm having trouble with the following scenario:\nMy name contains an é with accent. Having set\ngit config --global user.name \"René Haber\"\nand several commits with that name in a project.\nNow I wanted to pull with --rebase, which fails with:\n\ngit pull --rebase\nremote: Counting objects: 9, done.\nremote: Compressing objects: 100% (5/5), done.\nremote: Total 5 (delta 4), reused 0 (delta 0)\nUnpacking objects: 100% (5/5), done.\nFrom ____.de:repositories/kapa\n   173c610..18987db  master     -> origin/master\nFirst, rewinding head to replay your work on top of it...\n/sw/lib/git-core/git-am: line 675: Haber: command not found\nPatch does not have a valid e-mail address.\n\nThe problem lies in .git/rebase-apply/author-script :\n\nGIT_AUTHOR_NAME='Rene'́ Haber\nGIT_AUTHOR_EMAIL='rene@habr.de'\nGIT_AUTHOR_DATE='@1330931169 +0100'\n\nwhere the accent ´ is on top of the apostrophe and an apostrophe is missing from the end of the GIT_AUTHOR_NAME line.\nThis leads to the \"Haber: command not found\".\nAs the author name is taken from the rebased commits changing the user.name in the .gitconfig is useless.\nThe only way I found around this is changing my name to \"Rene Haber\" and first rewriting my local history up to the point of the rebase with that name.\n\nThanks for your help.\nRené Haber"},{"id":"186095","messageId":"20120305102657.GB29061@sigill.intra.peff.net","threadId":"29834","inReplyTo":"FECFDD4D-6EC3-4DE1-8A08-B4477345C4AA@habr.de","subject":"Re: Bug: pull --rebase with é in name","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-05T10:26:57Z","receivedAt":"2012-03-05T10:26:57Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Mar 05, 2012 at 10:59:16AM +0100, René Haber wrote:\n\n> I'm having trouble with the following scenario:\n> My name contains an é with accent. Having set\n> git config --global user.name \"René Haber\"\n> and several commits with that name in a project.\n\nThat should work in general, but...\n\n> git pull --rebase\n> [...]\n> /sw/lib/git-core/git-am: line 675: Haber: command not found\n> \n> The problem lies in .git/rebase-apply/author-script :\n> \n> GIT_AUTHOR_NAME='Rene'́ Haber\n> GIT_AUTHOR_EMAIL='rene@habr.de'\n> GIT_AUTHOR_DATE='@1330931169 +0100'\n\nThat's definitely not right.\n\nI can't seem to reproduce it here with a simple test (neither with\n\"René\" in the author name, nor with an author name containing\nsingle-quote). What version of git are you using (it looks like a recent\none, as it has the magic @-date syntax). Have you set\ni18n.commitencoding, or are otherwise using an encoding besides utf8? Is\nit possible to share the commits that trigger this bug?\n\n-Peff\n"},{"id":"186097","messageId":"87399nqqog.fsf@thomas.inf.ethz.ch","threadId":"29834","inReplyTo":"20120305102657.GB29061@sigill.intra.peff.net","subject":"Re: Bug: pull --rebase with é in name","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2012-03-05T10:37:35Z","receivedAt":"2012-03-05T10:37:35Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Mon, Mar 05, 2012 at 10:59:16AM +0100, René Haber wrote:\n>\n>> I'm having trouble with the following scenario:\n>> My name contains an é with accent. Having set\n>> git config --global user.name \"René Haber\"\n>> and several commits with that name in a project.\n>\n> That should work in general, but...\n>\n>> git pull --rebase\n>> [...]\n>> /sw/lib/git-core/git-am: line 675: Haber: command not found\n>> \n>> The problem lies in .git/rebase-apply/author-script :\n>> \n>> GIT_AUTHOR_NAME='Rene'́ Haber\n>> GIT_AUTHOR_EMAIL='rene@habr.de'\n>> GIT_AUTHOR_DATE='@1330931169 +0100'\n>\n> That's definitely not right.\n>\n> I can't seem to reproduce it here with a simple test (neither with\n> \"René\" in the author name, nor with an author name containing\n> single-quote). What version of git are you using (it looks like a recent\n> one, as it has the magic @-date syntax). Have you set\n> i18n.commitencoding, or are otherwise using an encoding besides utf8? Is\n> it possible to share the commits that trigger this bug?\n\nAlso, can you post a hex dump of the config that defines user.name (try\n'xxd ~/.gitconfig'), so we can see the encoding of René?\n\nI find it pretty odd that Git manages to split the ´ from the e, so I'm\nwondering if perhaps you are using UTF-8 in NFD or similar.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"186099","messageId":"F5A485EA-7EAD-4D8B-87C4-7185F713318C@habr.de","threadId":"29834","inReplyTo":"87399nqqog.fsf@thomas.inf.ethz.ch","subject":"Re: Bug: pull --rebase with é in name","fromName":"René Haber","fromEmail":"rene@habr.de","sentAt":"2012-03-05T11:42:14Z","receivedAt":"2012-03-05T11:42:14Z","isPatch":false,"sender":{"key":"rene@habr.de","avatar":null},"body":"I'm running git 1.7.9.2 from Fink Project on MacOS X 10.6.\nThe gitconfig in hex is attached.\nI'm not using i18n.commitencoding or a charset different from utf8.\n\nThanks.\nRené\n\n\n\n\nAm 05.03.2012 um 11:37 schrieb Thomas Rast:\n\n> Jeff King <peff@peff.net> writes:\n> \n>> On Mon, Mar 05, 2012 at 10:59:16AM +0100, René Haber wrote:\n>> \n>>> I'm having trouble with the following scenario:\n>>> My name contains an é with accent. Having set\n>>> git config --global user.name \"René Haber\"\n>>> and several commits with that name in a project.\n>> \n>> That should work in general, but...\n>> \n>>> git pull --rebase\n>>> [...]\n>>> /sw/lib/git-core/git-am: line 675: Haber: command not found\n>>> \n>>> The problem lies in .git/rebase-apply/author-script :\n>>> \n>>> GIT_AUTHOR_NAME='Rene'́ Haber\n>>> GIT_AUTHOR_EMAIL='rene@habr.de'\n>>> GIT_AUTHOR_DATE='@1330931169 +0100'\n>> \n>> That's definitely not right.\n>> \n>> I can't seem to reproduce it here with a simple test (neither with\n>> \"René\" in the author name, nor with an author name containing\n>> single-quote). What version of git are you using (it looks like a recent\n>> one, as it has the magic @-date syntax). Have you set\n>> i18n.commitencoding, or are otherwise using an encoding besides utf8? Is\n>> it possible to share the commits that trigger this bug?\n> \n> Also, can you post a hex dump of the config that defines user.name (try\n> 'xxd ~/.gitconfig'), so we can see the encoding of René?\n> \n> I find it pretty odd that Git manages to split the ´ from the e, so I'm\n> wondering if perhaps you are using UTF-8 in NFD or similar.\n> \n> -- \n> Thomas Rast\n> trast@{inf,student}.ethz.ch\n\n"},{"id":"186100","messageId":"20120305115815.GA4550@sigill.intra.peff.net","threadId":"29834","inReplyTo":"F5A485EA-7EAD-4D8B-87C4-7185F713318C@habr.de","subject":"Re: Bug: pull --rebase with é in name","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-05T11:58:15Z","receivedAt":"2012-03-05T11:58:15Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Mar 05, 2012 at 12:42:14PM +0100, René Haber wrote:\n\n> I'm running git 1.7.9.2 from Fink Project on MacOS X 10.6.\n> The gitconfig in hex is attached.\n\nHmm, looks like pretty standard utf8:\n\n  0000020: 6d65 203d 2052 656e c3a9 2048 6162 6572  me = Ren.. Haber\n\nand the same thing I used in my tests. I tried repeating the test with\nv1.7.9.2 on OS X (although my test box is 10.7), and couldn't replicate\nit.\n\nCan you show us the commit that causes the problem, as printed by \"git\ncat-file commit $commit | xxd\"? I just want to double-check that there\nare no odd bytes there.\n\nAlso, what happens if you do:\n\n  sh -c '\n    . /sw/lib/git-core/git-sh-setup\n     get_author_ident_from_commit $commit\n  '\n\n(my theory is that this is the underlying problem in the rebase, and\nshould show the bug; by narrowing it down, it should make testing a lot\nsimpler).\n\n-Peff\n"},{"id":"186101","messageId":"m3aa3vteat.fsf@localhost.localdomain","threadId":"29834","inReplyTo":"20120305115815.GA4550@sigill.intra.peff.net","subject":"Re: Bug: pull --rebase with é in name","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2012-03-05T12:36:48Z","receivedAt":"2012-03-05T12:36:48Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Mon, Mar 05, 2012 at 12:42:14PM +0100, René Haber wrote:\n> \n> > I'm running git 1.7.9.2 from Fink Project on MacOS X 10.6.\n> > The gitconfig in hex is attached.\n> \n> Hmm, looks like pretty standard utf8:\n> \n>   0000020: 6d65 203d 2052 656e c3a9 2048 6162 6572  me = Ren.. Haber\n> \n> and the same thing I used in my tests. I tried repeating the test with\n> v1.7.9.2 on OS X (although my test box is 10.7), and couldn't replicate\n> it.\n> \n> Can you show us the commit that causes the problem, as printed by \"git\n> cat-file commit $commit | xxd\"? I just want to double-check that there\n> are no odd bytes there.\n> \n> Also, what happens if you do:\n> \n>   sh -c '\n>     . /sw/lib/git-core/git-sh-setup\n>      get_author_ident_from_commit $commit\n>   '\n> \n> (my theory is that this is the underlying problem in the rebase, and\n> should show the bug; by narrowing it down, it should make testing a lot\n> simpler).\n\nHmmm... one place where I have read about this strange \"René\" -> \"Rene'\"\nconversion is when terminal (console) cannot display unicode, and tries\nto show it using ASCII:\n\n  http://stackoverflow.com/a/9430419/46058\n\nBut it should not matter if we are writing to file, isn't it?\n\n-- \nJakub Narębski\n"},{"id":"186102","messageId":"0E2B8DE3-1ABD-453F-BCAA-0D693ECA5987@habr.de","threadId":"29834","inReplyTo":"20120305115815.GA4550@sigill.intra.peff.net","subject":"Re: Bug: pull --rebase with é in name","fromName":"René Haber","fromEmail":"rene@habr.de","sentAt":"2012-03-05T12:46:39Z","receivedAt":"2012-03-05T12:46:39Z","isPatch":false,"sender":{"key":"rene@habr.de","avatar":null},"body":"sh -c '                                   \n   . /sw/lib/git-core/git-sh-setup\n    get_author_ident_from_commit 16b94413cbce12531e8f946286851598449d3913\n '\nGIT_AUTHOR_NAME='Ren'é Haber\nGIT_AUTHOR_EMAIL='rene@habr.de'\nGIT_AUTHOR_DATE='@1329212923 +0100'\n\nCommit attached.\n\nThe thing is, that this only happens when I do git pull --rebase.\nDoing a git rebase -i HEAD~5 or so works.\n\n\n\n\n\nAm 05.03.2012 um 12:58 schrieb Jeff King:\n\n> On Mon, Mar 05, 2012 at 12:42:14PM +0100, René Haber wrote:\n> \n>> I'm running git 1.7.9.2 from Fink Project on MacOS X 10.6.\n>> The gitconfig in hex is attached.\n> \n> Hmm, looks like pretty standard utf8:\n> \n>  0000020: 6d65 203d 2052 656e c3a9 2048 6162 6572  me = Ren.. Haber\n> \n> and the same thing I used in my tests. I tried repeating the test with\n> v1.7.9.2 on OS X (although my test box is 10.7), and couldn't replicate\n> it.\n> \n> Can you show us the commit that causes the problem, as printed by \"git\n> cat-file commit $commit | xxd\"? I just want to double-check that there\n> are no odd bytes there.\n> \n> Also, what happens if you do:\n> \n>  sh -c '\n>    . /sw/lib/git-core/git-sh-setup\n>     get_author_ident_from_commit $commit\n>  '\n> \n> (my theory is that this is the underlying problem in the rebase, and\n> should show the bug; by narrowing it down, it should make testing a lot\n> simpler).\n> \n> -Peff\n\n"},{"id":"186103","messageId":"87ipijkxlm.fsf@thomas.inf.ethz.ch","threadId":"29834","inReplyTo":"0E2B8DE3-1ABD-453F-BCAA-0D693ECA5987@habr.de","subject":"Re: Bug: pull --rebase with é in name","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2012-03-05T13:04:37Z","receivedAt":"2012-03-05T13:04:37Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"René Haber <rene@habr.de> writes:\n\n> sh -c '                                   \n>    . /sw/lib/git-core/git-sh-setup\n>     get_author_ident_from_commit 16b94413cbce12531e8f946286851598449d3913\n>  '\n> GIT_AUTHOR_NAME='Ren'é Haber\n> GIT_AUTHOR_EMAIL='rene@habr.de'\n> GIT_AUTHOR_DATE='@1329212923 +0100'\n\nI think this is the same issue that we recently discussed on #git-devel,\nwhere some broken versions of sed will fail to match \"any character\"\nwith '.' even under LC_ALL=C.  Will \"shruggar\" Palmer (cc) had this\nissue under OS X with a build of GNU sed that ignored LC_*.\n\nYou can verify that this is the problem by looking at\n\n  printf \"\\370\\235\\204\\236\\n\" | LC_CTYPE=C sed 's/./x/g' | xxd\n\nIt should say\n\n  0000000: 7878 7878 0a                             xxxx.\n\nThat is, the garbage (if you try to read it as UTF-8) in the printf\nstring was matched and replaced byte-by-byte with 'x'.  However,\nWill was getting the unreplaced results\n\n  0000000: f89d 849e 0a                             .....\n\nI'm not sure he has followed up on that problem; the only hope may be to\nget a better 'sed'.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"186104","messageId":"47F94015-B812-4034-9910-17912AC0ADA7@habr.de","threadId":"29834","inReplyTo":"87ipijkxlm.fsf@thomas.inf.ethz.ch","subject":"Re: Bug: pull --rebase with é in name","fromName":"René Haber","fromEmail":"rene@habr.de","sentAt":"2012-03-05T13:19:08Z","receivedAt":"2012-03-05T13:19:08Z","isPatch":false,"sender":{"key":"rene@habr.de","avatar":null},"body":"Am 05.03.2012 um 14:04 schrieb Thomas Rast:\n\n> René Haber <rene@habr.de> writes:\n> \n>> sh -c '                                   \n>>   . /sw/lib/git-core/git-sh-setup\n>>    get_author_ident_from_commit 16b94413cbce12531e8f946286851598449d3913\n>> '\n>> GIT_AUTHOR_NAME='Ren'é Haber\n>> GIT_AUTHOR_EMAIL='rene@habr.de'\n>> GIT_AUTHOR_DATE='@1329212923 +0100'\n> \n> I think this is the same issue that we recently discussed on #git-devel,\n> where some broken versions of sed will fail to match \"any character\"\n> with '.' even under LC_ALL=C.  Will \"shruggar\" Palmer (cc) had this\n> issue under OS X with a build of GNU sed that ignored LC_*.\n> \n> You can verify that this is the problem by looking at\n> \n>  printf \"\\370\\235\\204\\236\\n\" | LC_CTYPE=C sed 's/./x/g' | xxd\n> \n> It should say\n> \n>  0000000: 7878 7878 0a                             xxxx.\n> \n> That is, the garbage (if you try to read it as UTF-8) in the printf\n> string was matched and replaced byte-by-byte with 'x'.  However,\n> Will was getting the unreplaced results\n> \n>  0000000: f89d 849e 0a                             .....\n> \n> I'm not sure he has followed up on that problem; the only hope may be to\n> get a better 'sed'.\nI can conform this. I get .....\nUsing the sed from apple results in xxxx.\n\nThanks.\nRené\n\n> -- \n> Thomas Rast\n> trast@{inf,student}.ethz.ch\n"},{"id":"186105","messageId":"20120305132913.GA15004@sigill.intra.peff.net","threadId":"29834","inReplyTo":"87ipijkxlm.fsf@thomas.inf.ethz.ch","subject":"Re: Bug: pull --rebase with é in name","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-05T13:29:13Z","receivedAt":"2012-03-05T13:29:13Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Mar 05, 2012 at 02:04:37PM +0100, Thomas Rast wrote:\n\n> René Haber <rene@habr.de> writes:\n> \n> > sh -c '                                   \n> >    . /sw/lib/git-core/git-sh-setup\n> >     get_author_ident_from_commit 16b94413cbce12531e8f946286851598449d3913\n> >  '\n> > GIT_AUTHOR_NAME='Ren'é Haber\n> > GIT_AUTHOR_EMAIL='rene@habr.de'\n> > GIT_AUTHOR_DATE='@1329212923 +0100'\n> [...]\n> That is, the garbage (if you try to read it as UTF-8) in the printf\n> string was matched and replaced byte-by-byte with 'x'.  However,\n> Will was getting the unreplaced results\n> \n>   0000000: f89d 849e 0a                             .....\n> \n> I'm not sure he has followed up on that problem; the only hope may be to\n> get a better 'sed'.\n\nLong ago, 47c9739e replaced the shell quoting in git-am with \"git\nrev-parse --sq-quote\" (instead of sed). Maybe we can do the same for\nget_author_ident_from_commit (though it is a little trickier there, as\nwe are also parsing values directly out of --pretty=raw).\n\nIt would be nice if the --pretty format placeholders had a \"shell-quote\"\nmodifier, and we could just do:\n\n  git show --format='GIT_AUTHOR_NAME=%(an:shell)'\n\nor something similar. for-each-ref knows about shell-quoting, but we\ncan't use it here, because we are looking at arbitrary commits, not just\nones pointed to by refs.\n\n-Peff\n"},{"id":"186107","messageId":"87r4x7jhd9.fsf@thomas.inf.ethz.ch","threadId":"29834","inReplyTo":"20120305132913.GA15004@sigill.intra.peff.net","subject":"Re: Bug: pull --rebase with é in name","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2012-03-05T13:40:34Z","receivedAt":"2012-03-05T13:40:34Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Mon, Mar 05, 2012 at 02:04:37PM +0100, Thomas Rast wrote:\n>\n>> René Haber <rene@habr.de> writes:\n>> \n>> > sh -c '                                   \n>> >    . /sw/lib/git-core/git-sh-setup\n>> >     get_author_ident_from_commit 16b94413cbce12531e8f946286851598449d3913\n>> >  '\n>> > GIT_AUTHOR_NAME='Ren'é Haber\n>> > GIT_AUTHOR_EMAIL='rene@habr.de'\n>> > GIT_AUTHOR_DATE='@1329212923 +0100'\n>> [...]\n>> That is, the garbage (if you try to read it as UTF-8) in the printf\n>> string was matched and replaced byte-by-byte with 'x'.  However,\n>> Will was getting the unreplaced results\n>> \n>>   0000000: f89d 849e 0a                             .....\n>> \n>> I'm not sure he has followed up on that problem; the only hope may be to\n>> get a better 'sed'.\n[...]\n> It would be nice if the --pretty format placeholders had a \"shell-quote\"\n> modifier, and we could just do:\n>\n>   git show --format='GIT_AUTHOR_NAME=%(an:shell)'\n>\n> or something similar. for-each-ref knows about shell-quoting, but we\n> can't use it here, because we are looking at arbitrary commits, not just\n> ones pointed to by refs.\n\nPerhaps by using %an etc., line numbers and --sq-quote:\n\n  $ git rev-list --no-walk --date=raw --format=\"%an%n%ae%n%ad\" --encoding=UTF-8 HEAD |\n    while read -r s; do git rev-parse --sq-quote \"$s\"; done |\n    sed -n -e '2s/^ /GIT_AUTHOR_NAME=/p' -e '3s/^ /GIT_AUTHOR_EMAIL=/p' -e '4s/^ /GIT_AUTHOR_DATE=/p'\n  GIT_AUTHOR_NAME='Thom'\\''as Ràst'\n  GIT_AUTHOR_EMAIL='trast@inf.ethz.ch'\n  GIT_AUTHOR_DATE='1330935546 +0100'\n\nThis is for a commit where I deliberately mangled my author line to make\nan interesting example, as in\n\n  $ git cat-file commit HEAD | grep ^author\n  author Thom'as Ràst <trast@inf.ethz.ch> 1330935546 +0100\n\nI tried doing the quoting inside sed instead of the while...rev-parse\n--sq-quote, but it made my head hurt.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"186109","messageId":"20120305135010.GA17189@sigill.intra.peff.net","threadId":"29834","inReplyTo":"87r4x7jhd9.fsf@thomas.inf.ethz.ch","subject":"Re: Bug: pull --rebase with é in name","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-05T13:50:10Z","receivedAt":"2012-03-05T13:50:10Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Mar 05, 2012 at 02:40:34PM +0100, Thomas Rast wrote:\n\n> > It would be nice if the --pretty format placeholders had a \"shell-quote\"\n> > modifier, and we could just do:\n> >\n> >   git show --format='GIT_AUTHOR_NAME=%(an:shell)'\n> >\n> > or something similar. for-each-ref knows about shell-quoting, but we\n> > can't use it here, because we are looking at arbitrary commits, not just\n> > ones pointed to by refs.\n> \n> Perhaps by using %an etc., line numbers and --sq-quote:\n> \n>   $ git rev-list --no-walk --date=raw --format=\"%an%n%ae%n%ad\" --encoding=UTF-8 HEAD |\n>     while read -r s; do git rev-parse --sq-quote \"$s\"; done |\n>     sed -n -e '2s/^ /GIT_AUTHOR_NAME=/p' -e '3s/^ /GIT_AUTHOR_EMAIL=/p' -e '4s/^ /GIT_AUTHOR_DATE=/p'\n>   GIT_AUTHOR_NAME='Thom'\\''as Ràst'\n>   GIT_AUTHOR_EMAIL='trast@inf.ethz.ch'\n>   GIT_AUTHOR_DATE='1330935546 +0100'\n\nYeah, that works. It's a little harder to read than would be ideal, but\nshould produce the right results (I was initially hesitant to use \"read\"\nbecause I was worried about newlines in the input. But of course, that's\na non-issue since author ident by definition cannot have newlines in\nit).\n\nI think this is a good direction regardless of the sed issue. We end up\nparsing ident lines like this in a lot of different places, and I would\nnot be surprised if they do not all behave exactly the same. Eliminating\none such parser in favor of the standard one in pretty.c seems like a\ngood thing.\n\n-Peff\n\nPS If you are going to turn that into a real patch, note that your date\n   field accidentally drops the \"@\" specifier that unambiguously marks\n   the number as an epoch timestamp.\n"},{"id":"186124","messageId":"7v8vjf2c8o.fsf@alter.siamese.dyndns.org","threadId":"29834","inReplyTo":"20120305132913.GA15004@sigill.intra.peff.net","subject":"Re: Bug: pull --rebase with é in name","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-05T17:23:19Z","receivedAt":"2012-03-05T17:23:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> It would be nice if the --pretty format placeholders had a \"shell-quote\"\n> modifier, and we could just do:\n>\n>   git show --format='GIT_AUTHOR_NAME=%(an:shell)'\n>\n> or something similar. for-each-ref knows about shell-quoting, but we\n> can't use it here, because we are looking at arbitrary commits, not just\n> ones pointed to by refs.\n\nYou guys seem to have been having a lot of fun overnight. Perhaps I\nshould live on European time?\n\nI think there were talks about cross pollinating and eventually\nunifying the placeholder languages of pretty and for-each-ref, and\nif we were to do so, I agree that --pretty definitely should learn\nto do --sq. But I do not think we want to teach everything :shell;\nfollowing the style of %w(), something more generic that would apply\nto any payload would be preferred, perhaps giving an end result like\nthis:\n\n\tgit show -s --format='\n\t\tGIT_AUTHOR_NAME=%(sq-begin)%an%(sq-end)\n                GIT_AUTHOR_EMAIL=%(sq-begin)%ae%(sq-end)\n        '\n\nwhich would be immediately `eval`-able.\n\nAlso I wonder if it is time for \"git-am\" to make more use of direct\nknowledge of the $rebasing and the original commit. Perhaps by\nteaching commit-tree to take the -c option from commit, we may not\neven have to worry about this.\n\nIn any case, my reading of the conclusion you guys have already\nreached in this thread is that the issue is not even a bug in Git,\nbut is a broken build/installation of sed by a third-party.  I am\ninclined to suggest any change to get_author_ident_from_commit\nhelper backburnered before we teach --sq to --pretty machinery.\n\nIf the broken sed was the apple one that came with the platform, my\nconclusion might be different, but it seems to me that this is not\nsomething we would urgently have to worry about and patch our code\nup with an ugly band-aid workaround.\n"},{"id":"186177","messageId":"20120306082303.GC21199@sigill.intra.peff.net","threadId":"29834","inReplyTo":"7v8vjf2c8o.fsf@alter.siamese.dyndns.org","subject":"Re: Bug: pull --rebase with é in name","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-06T08:23:03Z","receivedAt":"2012-03-06T08:23:03Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Mar 05, 2012 at 09:23:19AM -0800, Junio C Hamano wrote:\n\n> I think there were talks about cross pollinating and eventually\n> unifying the placeholder languages of pretty and for-each-ref, and\n> if we were to do so, I agree that --pretty definitely should learn\n> to do --sq. But I do not think we want to teach everything :shell;\n> following the style of %w(), something more generic that would apply\n> to any payload would be preferred, perhaps giving an end result like\n> this:\n> \n> \tgit show -s --format='\n> \t\tGIT_AUTHOR_NAME=%(sq-begin)%an%(sq-end)\n>                 GIT_AUTHOR_EMAIL=%(sq-begin)%ae%(sq-end)\n>         '\n> \n> which would be immediately `eval`-able.\n\nYeah, that could work. I didn't want to teach everything :shell\nindividually. I was hoping eventually for a world where\n\"%(foo:one:two=bar)\" was internally parsed into \"the foo item, with\nattribute one set, and attribute two set to bar\". And then the \"shell\"\nattribute would have a particular meaning for everything, whereas\nin \"%(authordate:format=short)\", the \"format\" attribute would be\nspecific to that item.\n\nI think that makes for a more readable syntax. However, your proposal\ndoes allow quoting multiple entities at a time, like:\n\n  IDENT=%(sq-begin)%an <%ae>%(sq-end)\n\nwhich could be useful.\n\nAnyway, there is not much point in discussing hypothetical syntaxes. I\nthink we agree that some form of this feature would be an ideal way\nforward in the long term, but specifics can wait until somebody shows up\nwith patches.\n\n> In any case, my reading of the conclusion you guys have already\n> reached in this thread is that the issue is not even a bug in Git,\n> but is a broken build/installation of sed by a third-party.  I am\n> inclined to suggest any change to get_author_ident_from_commit\n> helper backburnered before we teach --sq to --pretty machinery.\n\nI think that is true. It could be considered a bug in git if we were\nrelying on an unportable sed construct. But it works everywhere else,\nand we already go to the effort to set LANG and LC_ALL, so I am inclined\nto say that it is not a portability issue in git, but a crappy sed\nimplementation, and the right solution is to use a better one.\n\nWe could switch the use of sed to perl (even just using 5.005-ish\nfeatures, which are pretty portable), but until now, users of\ngit-sh-setup don't need to rely on having perl at all.\n\nSo I'm fine with leaving it for now and telling people to fix their sed.\n\n-Peff\n"},{"id":"186180","messageId":"87399mazxs.fsf@thomas.inf.ethz.ch","threadId":"29834","inReplyTo":"7v8vjf2c8o.fsf@alter.siamese.dyndns.org","subject":"Re: Bug: pull --rebase with é in name","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2012-03-06T08:36:31Z","receivedAt":"2012-03-06T08:36:31Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Jeff King <peff@peff.net> writes:\n>\n>> It would be nice if the --pretty format placeholders had a \"shell-quote\"\n>> modifier, and we could just do:\n>>\n>>   git show --format='GIT_AUTHOR_NAME=%(an:shell)'\n>>\n>> or something similar. for-each-ref knows about shell-quoting, but we\n>> can't use it here, because we are looking at arbitrary commits, not just\n>> ones pointed to by refs.\n>\n> You guys seem to have been having a lot of fun overnight. Perhaps I\n> should live on European time?\n\nIIUC Peff just got up at an unreasonably early time to have fun with us\nEuropeans?\n\n> I think there were talks about cross pollinating and eventually\n> unifying the placeholder languages of pretty and for-each-ref, and\n> if we were to do so, I agree that --pretty definitely should learn\n> to do --sq. But I do not think we want to teach everything :shell;\n> following the style of %w(), something more generic that would apply\n> to any payload would be preferred, perhaps giving an end result like\n> this:\n>\n> \tgit show -s --format='\n> \t\tGIT_AUTHOR_NAME=%(sq-begin)%an%(sq-end)\n>                 GIT_AUTHOR_EMAIL=%(sq-begin)%ae%(sq-end)\n>         '\n\nHow about something along the lines of %Q(%an) instead?  Though at least\nimplementation-wise, it should be possible to make %'%an%' work, too,\nwhich would be rather cute.\n\n> In any case, my reading of the conclusion you guys have already\n> reached in this thread is that the issue is not even a bug in Git,\n> but is a broken build/installation of sed by a third-party.  I am\n> inclined to suggest any change to get_author_ident_from_commit\n> helper backburnered before we teach --sq to --pretty machinery.\n\nOk.\n\nThis is the second \"victim\" of this broken install of sed, however.  I\nwonder where René and Will got it from?  Perhaps this is \"the\" common\nway of getting GNU sed on OS X, and thus more widespread than we might\nthink.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"186188","messageId":"20120306090218.GG21199@sigill.intra.peff.net","threadId":"29834","inReplyTo":"87399mazxs.fsf@thomas.inf.ethz.ch","subject":"Re: Bug: pull --rebase with é in name","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-06T09:02:18Z","receivedAt":"2012-03-06T09:02:18Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 06, 2012 at 09:36:31AM +0100, Thomas Rast wrote:\n\n> > You guys seem to have been having a lot of fun overnight. Perhaps I\n> > should live on European time?\n> \n> IIUC Peff just got up at an unreasonably early time to have fun with us\n> Europeans?\n\nEr...got up? Yeeeeeah, that's what happened. I would never stay up until\n6am local time hacking on git. ;)\n\n> This is the second \"victim\" of this broken install of sed, however.  I\n> wonder where René and Will got it from?  Perhaps this is \"the\" common\n> way of getting GNU sed on OS X, and thus more widespread than we might\n> think.\n\nThat's worth looking into, but the answer may still be \"this common sed\nis broken, and we should tell the people who are packaging it to unbreak\nit\". I'm worried that there really isn't a workaround (we are already\ntrying LC_ALL and LANG; is there something else we can do short of not\nusing sed at all?).\n\n-Peff\n"},{"id":"186232","messageId":"7vmx7ttwcv.fsf@alter.siamese.dyndns.org","threadId":"29834","inReplyTo":"87399mazxs.fsf@thomas.inf.ethz.ch","subject":"Re: Bug: pull --rebase with é in name","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-06T18:31:12Z","receivedAt":"2012-03-06T18:31:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Rast <trast@inf.ethz.ch> writes:\n\n>> \tgit show -s --format='\n>> \t\tGIT_AUTHOR_NAME=%(sq-begin)%an%(sq-end)\n>>                 GIT_AUTHOR_EMAIL=%(sq-begin)%ae%(sq-end)\n>>         '\n>\n> How about something along the lines of %Q(%an) instead?  Though at least\n> implementation-wise, it should be possible to make %'%an%' work, too,\n> which would be rather cute.\n\nIt would be also less error prone from end user's point of view if\nyour closing token is not \")\" (as in %Q(%an)) but percent-something,\ne.g. %<%an%>, %`%an%', or %'%an%'.  The way to quote a string that\nhappens to be the same as closing token you want to put in the\nquoted string would be more obvious (e.g. ID=%Q(%ae (%an%29) is a\nbit hard to read for ID='gitster@pobox.com (J C H)').\n\n\tID=%'%ae (%an)%'\n\nAs I do not expect these things to nest (do we want to be able to\nformulate a string that can be eval'ed twice???), using the same\nstring for both opening and closing token is fine by me.\n"}]}