{"thread":{"id":"51707","subject":"[BUG] You can't have single quote in your username","startedAt":"2019-08-22T12:32:52Z","lastAt":"2019-09-03T09:03:27Z","messageCount":26,"participants":["Giuseppe Crinò","Pratyush Yadav","René Scharfe","Junio C Hamano","Bryan Turner","Emily Shaffer","Michal Suchánek","SZEDER Gábor","Jeff King","Giuseppe Crino'"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"380926","messageId":"CAGV3M55WAQOAOiZPPgR+6p2EVzakrbz1gYAMh-BqxCVDeLCq9w@mail.gmail.com","threadId":"51707","inReplyTo":null,"subject":"[BUG] You can't have single quote in your username","fromName":"Giuseppe Crinò","fromEmail":"giuscri@gmail.com","sentAt":"2019-08-22T12:32:54Z","receivedAt":"2019-08-22T12:32:52Z","isPatch":false,"sender":{"key":"giuscri@gmail.com","avatar":"https://gravatar.com/avatar/0d6b46f6496321ee3646c8712de0b475e225f393a8c72d2c2385d7820b74dd90?d=mp&s=160"},"body":"Note how `git log` discards the ending quote character:\n```\nroot@NBR1710R:~# git init repo\nInitialized empty Git repository in /root/repo/.git/\nroot@NBR1710R:~# cd repo/\nroot@NBR1710R:~/repo# git config user.name Les Actualite\\'\nroot@NBR1710R:~/repo# cat .git/config\n[core]\n        repositoryformatversion = 0\n        filemode = true\n        bare = false\n        logallrefupdates = true\n[user]\n        name = Les\nroot@NBR1710R:~/repo# git config user.name \"Les Actualite\\'\"\nroot@NBR1710R:~/repo# cat .git/config\n[core]\n        repositoryformatversion = 0\n        filemode = true\n        bare = false\n        logallrefupdates = true\n[user]\n        name = Les Actualite\\\\'\nroot@NBR1710R:~/repo# touch foo\nroot@NBR1710R:~/repo# git add foo\nroot@NBR1710R:~/repo# git commit -m 'first'\n[master (root-commit) a78e11f] first\n Committer: Les Actualite <root@NBR1710R>\nYour name and email address were configured automatically based\non your username and hostname. Please check that they are accurate.\nYou can suppress this message by setting them explicitly. Run the\nfollowing command and follow the instructions in your editor to edit\nyour configuration file:\n\n    git config --global --edit\n\nAfter doing this, you may fix the identity used for this commit with:\n\n    git commit --amend --reset-author\n\n 1 file changed, 0 insertions(+), 0 deletions(-)\n create mode 100644 foo\nroot@NBR1710R:~/repo# git log\ncommit a78e11ff0707bd4f1bea195735a7fc8b7ee2b9f8 (HEAD -> master)\nAuthor: Les Actualite <root@NBR1710R>\nDate:   Thu Aug 22 14:25:11 2019 +0200\n\n    first\n```\n\nI can't test with the development tree right now,\n```\nroot@NBR1710R:~/repo# git --version\ngit version 2.17.1\n```\n"},{"id":"380938","messageId":"20190822150614.o25g37pwfcaos2zn@localhost.localdomain","threadId":"51707","inReplyTo":"CAGV3M55WAQOAOiZPPgR+6p2EVzakrbz1gYAMh-BqxCVDeLCq9w@mail.gmail.com","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-08-22T15:06:14Z","receivedAt":"2019-08-22T15:06:20Z","isPatch":false,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"On 22/08/19 02:32PM, Giuseppe Crinò wrote:\n> Note how `git log` discards the ending quote character:\n> ```\n> root@NBR1710R:~# git init repo\n> Initialized empty Git repository in /root/repo/.git/\n> root@NBR1710R:~# cd repo/\n> root@NBR1710R:~/repo# git config user.name Les Actualite\\'\n> root@NBR1710R:~/repo# cat .git/config\n> [core]\n>         repositoryformatversion = 0\n>         filemode = true\n>         bare = false\n>         logallrefupdates = true\n> [user]\n>         name = Les\n> root@NBR1710R:~/repo# git config user.name \"Les Actualite\\'\"\n> root@NBR1710R:~/repo# cat .git/config\n> [core]\n>         repositoryformatversion = 0\n>         filemode = true\n>         bare = false\n>         logallrefupdates = true\n> [user]\n>         name = Les Actualite\\\\'\n> root@NBR1710R:~/repo# touch foo\n> root@NBR1710R:~/repo# git add foo\n> root@NBR1710R:~/repo# git commit -m 'first'\n> [master (root-commit) a78e11f] first\n>  Committer: Les Actualite <root@NBR1710R>\n> Your name and email address were configured automatically based\n> on your username and hostname. Please check that they are accurate.\n> You can suppress this message by setting them explicitly. Run the\n> following command and follow the instructions in your editor to edit\n> your configuration file:\n> \n>     git config --global --edit\n> \n> After doing this, you may fix the identity used for this commit with:\n> \n>     git commit --amend --reset-author\n> \n>  1 file changed, 0 insertions(+), 0 deletions(-)\n>  create mode 100644 foo\n> root@NBR1710R:~/repo# git log\n> commit a78e11ff0707bd4f1bea195735a7fc8b7ee2b9f8 (HEAD -> master)\n> Author: Les Actualite <root@NBR1710R>\n> Date:   Thu Aug 22 14:25:11 2019 +0200\n> \n>     first\n> ```\n> \n> I can't test with the development tree right now,\n> ```\n> root@NBR1710R:~/repo# git --version\n> git version 2.17.1\n> ```\n\nHi,\n\nI took a quick look into this problem. The issue is not with git log, \nbut instead with git commit. When you commit, \nbuiltin/commit.c::author_info() calls ident.c::fmt_ident(), which in \nturn calls ident.c::strbuf_addstr_without_crud(), which in turn calls \nident.c::crud().\n\nThis strbuf_addstr_without_crud() function removes various characters \nfrom the start and end of the author info, one of which is the single \nquotation. I'm not sure why this is done, the more experienced folk \nwhere will have the answer.\n\nAnyway, the fix is simple enough. Remove the lines that mark single \nquotes as crud in the crud() function. This will fix the issue for the \nfuture commits. If you need to fix it for past commits, you need to \nre-write your history with the fix applied.\n\nBelow is the quick-and-dirty patch that fixes this. If there is no \nreason for this patch to be dropped, I'll send a proper one once some \nother people have commented.\n\n-- >8 --\ndiff --git a/ident.c b/ident.c\nindex e666ee4e59..63cc5e32d3 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -204,9 +204,7 @@ static int crud(unsigned char c)\n \t\tc == ';' ||\n \t\tc == '<' ||\n \t\tc == '>' ||\n-\t\tc == '\"' ||\n-\t\tc == '\\\\' ||\n-\t\tc == '\\'';\n+\t\tc == '\"';\n }\n \n static int has_non_crud(const char *str)\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"380942","messageId":"fb5c0bb2-a5af-ef11-dada-a6e96fa7bdab@web.de","threadId":"51707","inReplyTo":"CAGV3M55WAQOAOiZPPgR+6p2EVzakrbz1gYAMh-BqxCVDeLCq9w@mail.gmail.com","subject":"Re: [BUG] You can't have single quote in your username","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2019-08-22T16:06:51Z","receivedAt":"2019-08-22T16:07:00Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 22.08.19 um 14:32 schrieb Giuseppe Crinò:\n>         name = Les Actualite\\\\'\n\nYou can name yourself anything you like, of course, and I don't actually\nspeak French, but wouldn't it rather be \"L'actualité\"?\n\nI just reply as a fellow accent-bearer, feel free to ignore me..\n\nRené\n"},{"id":"380945","messageId":"xmqqy2zlp3qn.fsf@gitster-ct.c.googlers.com","threadId":"51707","inReplyTo":"20190822150614.o25g37pwfcaos2zn@localhost.localdomain","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-08-22T16:24:48Z","receivedAt":"2019-08-22T16:25:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pratyush Yadav <me@yadavpratyush.com> writes:\n\n> This strbuf_addstr_without_crud() function removes various characters \n> from the start and end of the author info, one of which is the single \n> quotation. I'm not sure why this is done, the more experienced folk \n> where will have the answer.\n\nThe logic there exists in order to remove cruft around the name on a\ntypical e-mail header (remember, most of the very core-ish part of\nthe Git was written and got solidified back when the Linux kernel\nwas the primary client of the system, and many commits were created\nvia \"am\"), e.g. sender's mail client may send something like this:\n\n    From: 'Foo bar Baz' <my@name.xz>\n\nand we do not want to take surrounding sq pair as part of the name.\n"},{"id":"380953","messageId":"CAGyf7-EdxDn_BwguXNUNg76K9z30X0=C1btMR0dfiHR9bLjhwQ@mail.gmail.com","threadId":"51707","inReplyTo":"CAGV3M55WAQOAOiZPPgR+6p2EVzakrbz1gYAMh-BqxCVDeLCq9w@mail.gmail.com","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Bryan Turner","fromEmail":"bturner@atlassian.com","sentAt":"2019-08-22T16:58:48Z","receivedAt":"2019-08-22T16:59:01Z","isPatch":false,"sender":{"key":"bturner@atlassian.com","avatar":"https://gravatar.com/avatar/16bcf3167981c1ef7c804e502642366d888a35b0d0b0a4ca01fdc442aa1acb1e?d=mp&s=160"},"body":"On Thu, Aug 22, 2019 at 5:32 AM Giuseppe Crinò <giuscri@gmail.com> wrote:\n>\n> Note how `git log` discards the ending quote character:\n\n<snip>\n\n> root@NBR1710R:~/repo# git add foo\n> root@NBR1710R:~/repo# git commit -m 'first'\n> [master (root-commit) a78e11f] first\n>  Committer: Les Actualite <root@NBR1710R>\n\nIf you look closely here, in the \"git commit\" output, you can see\nthat, as Pratyush indicated, it was actually \"git commit\" that dropped\nthe trailing apostrophe, and \"git log\" is simply presenting the\ninformation as it exists in the repository.\n\nIf your goal is an accented \"e\", wouldn't it be better to set your\nname using é, rather than a trailing apostrophe? \"git commit\" would\nlikely preserve that without issue.\n\nBest regards,\nBryan Turner\n"},{"id":"380958","messageId":"20190822170817.GB35435@google.com","threadId":"51707","inReplyTo":"CAGyf7-EdxDn_BwguXNUNg76K9z30X0=C1btMR0dfiHR9bLjhwQ@mail.gmail.com","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Emily Shaffer","fromEmail":"emilyshaffer@google.com","sentAt":"2019-08-22T17:08:17Z","receivedAt":"2019-08-22T17:19:58Z","isPatch":false,"sender":{"key":"nasamuffin@google.com","avatar":"https://avatars.githubusercontent.com/u/1606826?v=4"},"body":"On Thu, Aug 22, 2019 at 09:58:48AM -0700, Bryan Turner wrote:\n> On Thu, Aug 22, 2019 at 5:32 AM Giuseppe Crinò <giuscri@gmail.com> wrote:\n> >\n> > Note how `git log` discards the ending quote character:\n> \n> <snip>\n> \n> > root@NBR1710R:~/repo# git add foo\n> > root@NBR1710R:~/repo# git commit -m 'first'\n> > [master (root-commit) a78e11f] first\n> >  Committer: Les Actualite <root@NBR1710R>\n> \n> If you look closely here, in the \"git commit\" output, you can see\n> that, as Pratyush indicated, it was actually \"git commit\" that dropped\n> the trailing apostrophe, and \"git log\" is simply presenting the\n> information as it exists in the repository.\n> \n> If your goal is an accented \"e\", wouldn't it be better to set your\n> name using é, rather than a trailing apostrophe? \"git commit\" would\n> likely preserve that without issue.\n\nHmm, I don't think it's a good idea to get into the business of telling\ncontributors how to write their names. There tends to be an axiom that\n\"all assumptions developers make about human names are false.\"\n\nDoes it make more sense to replace this strbuf_addstr_without_crud()\nsetup with something more intelligent (i.e. checking for matching crud\non either end, like ^[$crudchars].*\\1$? We already check for matched <>.\n\n- Emily\n"},{"id":"380966","messageId":"20190822184312.xhrf2ij3bh3vovrq@localhost.localdomain","threadId":"51707","inReplyTo":"20190822170817.GB35435@google.com","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Pratyush Yadav","fromEmail":"me@yadavpratyush.com","sentAt":"2019-08-22T18:43:12Z","receivedAt":"2019-08-22T18:43:32Z","isPatch":false,"sender":{"key":"me@yadavpratyush.com","avatar":"https://avatars.githubusercontent.com/u/8817931?v=4"},"body":"On 22/08/19 10:08AM, Emily Shaffer wrote:\n> On Thu, Aug 22, 2019 at 09:58:48AM -0700, Bryan Turner wrote:\n> > On Thu, Aug 22, 2019 at 5:32 AM Giuseppe Crinò <giuscri@gmail.com> wrote:\n> > >\n> > > Note how `git log` discards the ending quote character:\n> > \n> > <snip>\n> > \n> > > root@NBR1710R:~/repo# git add foo\n> > > root@NBR1710R:~/repo# git commit -m 'first'\n> > > [master (root-commit) a78e11f] first\n> > >  Committer: Les Actualite <root@NBR1710R>\n> > \n> > If you look closely here, in the \"git commit\" output, you can see\n> > that, as Pratyush indicated, it was actually \"git commit\" that dropped\n> > the trailing apostrophe, and \"git log\" is simply presenting the\n> > information as it exists in the repository.\n> > \n> > If your goal is an accented \"e\", wouldn't it be better to set your\n> > name using é, rather than a trailing apostrophe? \"git commit\" would\n> > likely preserve that without issue.\n> \n> Hmm, I don't think it's a good idea to get into the business of telling\n> contributors how to write their names. There tends to be an axiom that\n> \"all assumptions developers make about human names are false.\"\n> \n> Does it make more sense to replace this strbuf_addstr_without_crud()\n> setup with something more intelligent (i.e. checking for matching crud\n> on either end, like ^[$crudchars].*\\1$? We already check for matched <>.\n\nSounds like something easy enough to implement. There are two types of \ncharacters that crud() removes: there are the ones which _should_ appear \non both the start and end (', \", <, >), and the ones which don't \nnecessarily have to (., ,, :, ;, \\).\n\nSo we'd need to handle two cases. For the former type, remove a \ncharacter both at the start and at the end. For the latter, remove only \nwhere they appear.\n\nIf this sounds like something reasonable to do, I'll send a patch fixing \nthis.\n\n-- \nRegards,\nPratyush Yadav\n"},{"id":"381000","messageId":"CAGV3M54RZn9pWe=R-qfm0UCU6TOhLc7-6H60Zf03gOe5Sq6wzw@mail.gmail.com","threadId":"51707","inReplyTo":"xmqqy2zlp3qn.fsf@gitster-ct.c.googlers.com","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Giuseppe Crinò","fromEmail":"giuscri@gmail.com","sentAt":"2019-08-23T07:20:47Z","receivedAt":"2019-08-23T07:20:44Z","isPatch":false,"sender":{"key":"giuscri@gmail.com","avatar":"https://gravatar.com/avatar/0d6b46f6496321ee3646c8712de0b475e225f393a8c72d2c2385d7820b74dd90?d=mp&s=160"},"body":"On Thu, Aug 22, 2019 at 6:24 PM Junio C Hamano <gitster@pobox.com> wrote:\n> The logic there exists in order to remove cruft around the name on a\n> typical e-mail header (remember, most of the very core-ish part of\n> the Git was written and got solidified back when the Linux kernel\n> was the primary client of the system, and many commits were created\n> via \"am\"), e.g. sender's mail client may send something like this:\n>\n>     From: 'Foo bar Baz' <my@name.xz>\n>\n> and we do not want to take surrounding sq pair as part of the name.\n\nI see but _standard_ rules to escape characters should apply as I\nunderstand this. 'Foo bar Baz\\'s' should be allowed as it should \"Foo\nbar Baz's\". They should resolve to the same name too\n"},{"id":"381001","messageId":"20190823092934.5fd986c3@naga","threadId":"51707","inReplyTo":"CAGV3M54RZn9pWe=R-qfm0UCU6TOhLc7-6H60Zf03gOe5Sq6wzw@mail.gmail.com","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Michal Suchánek","fromEmail":"msuchanek@suse.de","sentAt":"2019-08-23T07:29:34Z","receivedAt":"2019-08-23T07:29:38Z","isPatch":false,"sender":{"key":"msuchanek@suse.de","avatar":"https://avatars.githubusercontent.com/u/787652?v=4"},"body":"On Fri, 23 Aug 2019 09:20:47 +0200\nGiuseppe Crinò <giuscri@gmail.com> wrote:\n\n> On Thu, Aug 22, 2019 at 6:24 PM Junio C Hamano <gitster@pobox.com> wrote:\n> > The logic there exists in order to remove cruft around the name on a\n> > typical e-mail header (remember, most of the very core-ish part of\n> > the Git was written and got solidified back when the Linux kernel\n> > was the primary client of the system, and many commits were created\n> > via \"am\"), e.g. sender's mail client may send something like this:\n> >\n> >     From: 'Foo bar Baz' <my@name.xz>\n> >\n> > and we do not want to take surrounding sq pair as part of the name.  \n> \n> I see but _standard_ rules to escape characters should apply as I\n> understand this. 'Foo bar Baz\\'s' should be allowed as it should \"Foo\n> bar Baz's\". They should resolve to the same name too\n\nIt would not be removed in this case regardless of the qouting. It is\nneither at the start nor at the end.\n\nThanks\n\nMichal\n"},{"id":"381002","messageId":"20190823082612.GA3775@szeder.dev","threadId":"51707","inReplyTo":"20190822170817.GB35435@google.com","subject":"Re: [BUG] You can't have single quote in your username","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-08-23T08:26:12Z","receivedAt":"2019-08-23T08:26:21Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Thu, Aug 22, 2019 at 10:08:17AM -0700, Emily Shaffer wrote:\n> On Thu, Aug 22, 2019 at 09:58:48AM -0700, Bryan Turner wrote:\n> > If your goal is an accented \"e\", wouldn't it be better to set your\n> > name using é, rather than a trailing apostrophe? \"git commit\" would\n> > likely preserve that without issue.\n> \n> Hmm, I don't think it's a good idea to get into the business of telling\n> contributors how to write their names.\n\nWell, maybe the contributor didn't know that Git can cope with\naccented characters in user names.\n\n"},{"id":"381003","messageId":"20190823082900.GG20404@szeder.dev","threadId":"51707","inReplyTo":"20190822184312.xhrf2ij3bh3vovrq@localhost.localdomain","subject":"Re: [BUG] You can't have single quote in your username","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-08-23T08:29:00Z","receivedAt":"2019-08-23T08:29:06Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Fri, Aug 23, 2019 at 12:13:12AM +0530, Pratyush Yadav wrote:\n> > Does it make more sense to replace this strbuf_addstr_without_crud()\n> > setup with something more intelligent (i.e. checking for matching crud\n> > on either end, like ^[$crudchars].*\\1$? We already check for matched <>.\n> \n> Sounds like something easy enough to implement. There are two types of \n> characters that crud() removes: there are the ones which _should_ appear \n> on both the start and end (', \", <, >), and the ones which don't \n> necessarily have to (., ,, :, ;, \\).\n> \n> So we'd need to handle two cases. For the former type, remove a \n> character both at the start and at the end. For the latter, remove only \n> where they appear.\n\nIf we go down this route, then someone might want to write ő as o\" or\nű as u\", which still supposed to be used in pairs, but what if someone\nwants to write ä as a:, ö as o:, ü as u:, ç as \"c,\", ş as \"s,\", etc.\n\nWhat I wonder is whether we really have to remove crud from the user\nname if it comes from the configuration.\n\n"},{"id":"381005","messageId":"CAGV3M54LVwHMkXd=wB3tQ_h4K0bJOZ43TxXZ8Fh5ZKfATBS57g@mail.gmail.com","threadId":"51707","inReplyTo":"20190823082900.GG20404@szeder.dev","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Giuseppe Crinò","fromEmail":"giuscri@gmail.com","sentAt":"2019-08-23T09:35:48Z","receivedAt":"2019-08-23T09:35:45Z","isPatch":false,"sender":{"key":"giuscri@gmail.com","avatar":"https://gravatar.com/avatar/0d6b46f6496321ee3646c8712de0b475e225f393a8c72d2c2385d7820b74dd90?d=mp&s=160"},"body":"On Fri, Aug 23, 2019 at 10:29 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> If we go down this route, then someone might want to write ő as o\" or\n> ű as u\", which still supposed to be used in pairs, but what if someone\n> wants to write ä as a:, ö as o:, ü as u:, ç as \"c,\", ş as \"s,\", etc.\n\nI don't know any language that uses ő or ű so I can't tell but it's\ndefinitely possible. In my country, sometimes the last name ends with\nan accented letter (mine ends with an \"o grave\") and people end up use\na single quote to avoid pissing off computers. That's standard thing.\n\nIn my current team I don't know enough of the setup of my colleagues\n(they may use CP1252) and that ò may be badly decoded.\n"},{"id":"381007","messageId":"20190823101508.GJ20404@szeder.dev","threadId":"51707","inReplyTo":"CAGV3M54LVwHMkXd=wB3tQ_h4K0bJOZ43TxXZ8Fh5ZKfATBS57g@mail.gmail.com","subject":"Re: [BUG] You can't have single quote in your username","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-08-23T10:15:08Z","receivedAt":"2019-08-23T10:15:14Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Fri, Aug 23, 2019 at 11:35:48AM +0200, Giuseppe Crinò wrote:\n> On Fri, Aug 23, 2019 at 10:29 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> > If we go down this route, then someone might want to write ő as o\" or\n> > ű as u\", which still supposed to be used in pairs, but what if someone\n> > wants to write ä as a:, ö as o:, ü as u:, ç as \"c,\", ş as \"s,\", etc.\n> \n> I don't know any language that uses ő or ű so I can't tell but it's\n> definitely possible.\n\nThe Hungarian alphabet has both, and I've seen them written like this\non old typewritten documents.  But that was decades ago, nowadays\nthey are either written properly as ő and ű, or without any accent at\nall (banks...).\n\n> In my country, sometimes the last name ends with\n> an accented letter (mine ends with an \"o grave\") and people end up use\n> a single quote to avoid pissing off computers. That's standard thing.\n> \n> In my current team I don't know enough of the setup of my colleagues\n> (they may use CP1252) and that ò may be badly decoded.\n"},{"id":"381070","messageId":"20190824174952.GA688@instance-template-1.europe-west6-a.c.vaulted-journal-250706.internal","threadId":"51707","inReplyTo":"20190823082900.GG20404@szeder.dev","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Giuseppe Crinò","fromEmail":"giuscri@gmail.com","sentAt":"2019-08-24T17:49:52Z","receivedAt":"2019-08-24T17:49:58Z","isPatch":false,"sender":{"key":"giuscri@gmail.com","avatar":"https://gravatar.com/avatar/0d6b46f6496321ee3646c8712de0b475e225f393a8c72d2c2385d7820b74dd90?d=mp&s=160"},"body":"On Fri, Aug 23, 2019 at 10:29:00AM +0200, SZEDER Gábor wrote:\n> What I wonder is whether we really have to remove crud from the user\n> name if it comes from the configuration.\n\nYes. If the primary use of removing crud is to remove quotes from a\nquoted name (as in `From: 'Foo baz Bar'`) why not directly removing\npairs of quotes around the name and leave crud _inside_ the name?\n"},{"id":"381094","messageId":"20190825080956.GA15000@instance-template-1.europe-west6-a.c.vaulted-journal-250706.internal","threadId":"51707","inReplyTo":"20190824174952.GA688@instance-template-1.europe-west6-a.c.vaulted-journal-250706.internal","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Giuseppe Crinò","fromEmail":"giuscri@gmail.com","sentAt":"2019-08-25T08:09:56Z","receivedAt":"2019-08-25T08:10:02Z","isPatch":false,"sender":{"key":"giuscri@gmail.com","avatar":"https://gravatar.com/avatar/0d6b46f6496321ee3646c8712de0b475e225f393a8c72d2c2385d7820b74dd90?d=mp&s=160"},"body":"On Sat, Aug 24, 2019 at 05:49:52PM +0000, Giuseppe Crinò wrote:\n> On Fri, Aug 23, 2019 at 10:29:00AM +0200, SZEDER Gábor wrote:\n> > What I wonder is whether we really have to remove crud from the user\n> > name if it comes from the configuration.\n> \n> Yes. If the primary use of removing crud is to remove quotes from a\n> quoted name (as in `From: 'Foo baz Bar'`) why not directly removing\n> pairs of quotes around the name and leave crud _inside_ the name?\n\nI keep forgetting crud is removed *around* the name.\n\nBy the way, it's probably more conservative to remove crud (without\nremoving quotes) and finally remove surrounding quote pairs.\n"},{"id":"381238","messageId":"20190826191455.GA25695@sigill.intra.peff.net","threadId":"51707","inReplyTo":"20190823082900.GG20404@szeder.dev","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-08-26T19:14:55Z","receivedAt":"2019-08-26T19:14:58Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Aug 23, 2019 at 10:29:00AM +0200, SZEDER Gábor wrote:\n\n> On Fri, Aug 23, 2019 at 12:13:12AM +0530, Pratyush Yadav wrote:\n> > > Does it make more sense to replace this strbuf_addstr_without_crud()\n> > > setup with something more intelligent (i.e. checking for matching crud\n> > > on either end, like ^[$crudchars].*\\1$? We already check for matched <>.\n> > \n> > Sounds like something easy enough to implement. There are two types of \n> > characters that crud() removes: there are the ones which _should_ appear \n> > on both the start and end (', \", <, >), and the ones which don't \n> > necessarily have to (., ,, :, ;, \\).\n> > \n> > So we'd need to handle two cases. For the former type, remove a \n> > character both at the start and at the end. For the latter, remove only \n> > where they appear.\n> \n> If we go down this route, then someone might want to write ő as o\" or\n> ű as u\", which still supposed to be used in pairs, but what if someone\n> wants to write ä as a:, ö as o:, ü as u:, ç as \"c,\", ş as \"s,\", etc.\n> \n> What I wonder is whether we really have to remove crud from the user\n> name if it comes from the configuration.\n\nProbably not. I think most of this crud-handling is really about pulling\nnames out of email. Digging around in the archive, one of the few\nentries that actually talks about this crud-removal being helpful is:\n\n  https://public-inbox.org/git/alpine.LFD.2.00.0812010836280.3256@nehalem.linux-foundation.org/\n\nSo it might make sense to push these rules into \"git mailinfo\" instead\nof applying them everywhere. But we'd still need something at least for\nGECOS, where \"Your Name,,,,\" is common.\n\nUnfortunately since these rules have been in place for ages, we don't\nreally know how often they're helping. Loosening it just for user.name,\netc is probably the most conservative choice.\n\nWe'd still want to keep the low-level removal of \"<>\\n\", since those are\nsyntactically significant to Git (i.e., if they sneak in you end up with\na broken commit object). There's some discussion in this thread (which\nis also about trailing single-quotes!):\n\n  https://public-inbox.org/git/20120629124122.GG1258@camk.edu.pl/\n\nAnother real-world case that would be helped is: \"Your Name, Jr.\":\n\n  https://public-inbox.org/git/CAMP44s2OoxUVFE57e8C2Km7rcGn88KkLXxdaA3s5RE6nZ7TU=A@mail.gmail.com/\n\n-Peff\n"},{"id":"381366","messageId":"20190827135149.GA1715@instance-template-2.europe-west6-a.c.vaulted-journal-250706.internal","threadId":"51707","inReplyTo":"20190826191455.GA25695@sigill.intra.peff.net","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Giuseppe Crino'","fromEmail":"giuscri@gmail.com","sentAt":"2019-08-27T13:51:49Z","receivedAt":"2019-08-27T13:51:55Z","isPatch":false,"sender":{"key":"giuscri@gmail.com","avatar":"https://gravatar.com/avatar/0d6b46f6496321ee3646c8712de0b475e225f393a8c72d2c2385d7820b74dd90?d=mp&s=160"},"body":"On Mon, Aug 26, 2019 at 03:14:55PM -0400, Jeff King wrote:\n> So it might make sense to push these rules into \"git mailinfo\" instead\n> of applying them everywhere. But we'd still need something at least for\n> GECOS, where \"Your Name,,,,\" is common.\n\nWhat's the GECOS you mean?\n"},{"id":"381367","messageId":"20190827163334.12d684b9@kitsune.suse.cz","threadId":"51707","inReplyTo":"20190827135149.GA1715@instance-template-2.europe-west6-a.c.vaulted-journal-250706.internal","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Michal Suchánek","fromEmail":"msuchanek@suse.de","sentAt":"2019-08-27T14:33:34Z","receivedAt":"2019-08-27T14:33:37Z","isPatch":false,"sender":{"key":"msuchanek@suse.de","avatar":"https://avatars.githubusercontent.com/u/787652?v=4"},"body":"On Tue, 27 Aug 2019 13:51:49 +0000\n\"Giuseppe Crino'\" <giuscri@gmail.com> wrote:\n\n> On Mon, Aug 26, 2019 at 03:14:55PM -0400, Jeff King wrote:\n> > So it might make sense to push these rules into \"git mailinfo\" instead\n> > of applying them everywhere. But we'd still need something at least for\n> > GECOS, where \"Your Name,,,,\" is common.  \n> \n> What's the GECOS you mean?\n\nhttps://en.wikipedia.org/wiki/Gecos_field\n"},{"id":"381439","messageId":"20190828143315.GA4477@instance-template-2.europe-west6-a.c.vaulted-journal-250706.internal","threadId":"51707","inReplyTo":"20190826191455.GA25695@sigill.intra.peff.net","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Giuseppe Crino'","fromEmail":"giuscri@gmail.com","sentAt":"2019-08-28T14:33:15Z","receivedAt":"2019-08-28T14:33:21Z","isPatch":false,"sender":{"key":"giuscri@gmail.com","avatar":"https://gravatar.com/avatar/0d6b46f6496321ee3646c8712de0b475e225f393a8c72d2c2385d7820b74dd90?d=mp&s=160"},"body":"On Mon, Aug 26, 2019 at 03:14:55PM -0400, Jeff King wrote:\n> But we'd still need something at least for\n> GECOS, where \"Your Name,,,,\" is common.\n\nAs I understand this, those commas are *not* removed by\nstrbuf_addstr_without_crud(). Instead they're skipped from /etc/pass\n-- see `ident.c/copy_gecos()`.\n"},{"id":"381442","messageId":"20190828145640.GC14432@sigill.intra.peff.net","threadId":"51707","inReplyTo":"20190828143315.GA4477@instance-template-2.europe-west6-a.c.vaulted-journal-250706.internal","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-08-28T14:56:41Z","receivedAt":"2019-08-28T14:56:43Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 28, 2019 at 02:33:15PM +0000, Giuseppe Crino' wrote:\n\n> On Mon, Aug 26, 2019 at 03:14:55PM -0400, Jeff King wrote:\n> > But we'd still need something at least for\n> > GECOS, where \"Your Name,,,,\" is common.\n> \n> As I understand this, those commas are *not* removed by\n> strbuf_addstr_without_crud(). Instead they're skipped from /etc/pass\n> -- see `ident.c/copy_gecos()`.\n\nYeah, you're right. This is a good example of how we are completely\nunclear on how often the crud-removal is helping. :)\n\nBut I think that does put us one step closer to possibly dropping the\ncrud-removal, if gecos is already handled (and hopefully \"mailinfo\" is\nalready cleaning up the names it parsers).\n\n-Peff\n"},{"id":"381625","messageId":"20190831131748.GA13001@instance-1.europe-west6-a.c.vaulted-journal-250706.internal","threadId":"51707","inReplyTo":"20190828145640.GC14432@sigill.intra.peff.net","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Giuseppe Crinò","fromEmail":"giuscri@gmail.com","sentAt":"2019-08-31T13:17:48Z","receivedAt":"2019-08-31T13:17:54Z","isPatch":false,"sender":{"key":"giuscri@gmail.com","avatar":"https://gravatar.com/avatar/0d6b46f6496321ee3646c8712de0b475e225f393a8c72d2c2385d7820b74dd90?d=mp&s=160"},"body":"On Mon, Aug 26, 2019 at 03:14:55PM -0400, Jeff King wrote:\n> We'd still want to keep the low-level removal of \"<>\\n\", since those are\n> syntactically significant to Git (i.e., if they sneak in you end up with\n> a broken commit object).\n\nWould it work to change `strbuf_addstr_without_crud()` such that instead of\nremoving crud from the beginning and *then* crud from the end, it removes crud\nas long as it's palindromic? Then the function proceeds to remove \"<>\\n\" from\nthe string as before.\n\nThat would implement the following _mappings_:\n\n'Foo bar' => Foo bar\nMicheal Jr. => Micheal Jr.\nMr. McDonalds => Mr. McDonalds\n\"John Baz\" => John Baz\n\"JJ\\x0a\" => JJ\n\nWhat do you think?\n"},{"id":"381653","messageId":"20190902154732.GD18593@sigill.intra.peff.net","threadId":"51707","inReplyTo":"20190831131748.GA13001@instance-1.europe-west6-a.c.vaulted-journal-250706.internal","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-09-02T15:47:33Z","receivedAt":"2019-09-02T15:47:37Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Aug 31, 2019 at 01:17:48PM +0000, Giuseppe Crinò wrote:\n\n> On Mon, Aug 26, 2019 at 03:14:55PM -0400, Jeff King wrote:\n> > We'd still want to keep the low-level removal of \"<>\\n\", since those are\n> > syntactically significant to Git (i.e., if they sneak in you end up with\n> > a broken commit object).\n> \n> Would it work to change `strbuf_addstr_without_crud()` such that instead of\n> removing crud from the beginning and *then* crud from the end, it removes crud\n> as long as it's palindromic? Then the function proceeds to remove \"<>\\n\" from\n> the string as before.\n> \n> That would implement the following _mappings_:\n> \n> 'Foo bar' => Foo bar\n> Micheal Jr. => Micheal Jr.\n> Mr. McDonalds => Mr. McDonalds\n> \"John Baz\" => John Baz\n> \"JJ\\x0a\" => JJ\n> \n> What do you think?\n\nI think we don't have enough data to really know how much it will help\nor hurt. :)\n\nOn the plus side, it is less risky than dropping the end-point crud removal\nentirely.\n\nBut it still risks losing a case where some code path relies on the crud\ncleanup for odd cases (mismatched delimiters, or interleaved delimiters,\nor non-delimiter crud mixed in with delimiters).\n\nOn the one hand, I am actually OK with dropping the crud removal\nentirely and seeing what happens, and this is a lesser form of that. On\nthe other hand, it puts us in a funny in-between situation where tools\ncan _usually_ get away without cleaning up the names, but occasionally\nget bit. It might be easier to just say that we don't do cleanup.\n\nSo I dunno. There is no patch to be discussed, and I am not volunteering\nto write one.  So I think whoever chooses to do so has a lot of control\nover what is proposed. :)\n\n-Peff\n"},{"id":"381681","messageId":"xmqq1rwyv6tq.fsf@gitster-ct.c.googlers.com","threadId":"51707","inReplyTo":"20190902154732.GD18593@sigill.intra.peff.net","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-09-02T19:25:37Z","receivedAt":"2019-09-02T19:25:45Z","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> But it still risks losing a case where some code path relies on the crud\n> cleanup for odd cases (mismatched delimiters, or interleaved delimiters,\n> or non-delimiter crud mixed in with delimiters).\n> ...\n> So I dunno. There is no patch to be discussed, and I am not volunteering\n> to write one.  So I think whoever chooses to do so has a lot of control\n> over what is proposed. :)\n\nRather, they can propose what they want, but they have a lot of\ntough defending to do on their choice.  Lack of potential harm is\nmuch harder to prove than coming up with a single example that\nharms.\n\nI'd rather leave the sleeping dog lie, if we need to encourage\npeople to live in 21st century and step outside US-ASCII to do so,\nthen do that instead.\n"},{"id":"381686","messageId":"20190902215048.31a69442@naga","threadId":"51707","inReplyTo":"xmqq1rwyv6tq.fsf@gitster-ct.c.googlers.com","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Michal Suchánek","fromEmail":"msuchanek@suse.de","sentAt":"2019-09-02T19:50:48Z","receivedAt":"2019-09-02T19:51:02Z","isPatch":false,"sender":{"key":"msuchanek@suse.de","avatar":"https://avatars.githubusercontent.com/u/787652?v=4"},"body":"On Mon, 02 Sep 2019 12:25:37 -0700\nJunio C Hamano <gitster@pobox.com> wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > But it still risks losing a case where some code path relies on the crud\n> > cleanup for odd cases (mismatched delimiters, or interleaved delimiters,\n> > or non-delimiter crud mixed in with delimiters).\n> > ...\n> > So I dunno. There is no patch to be discussed, and I am not volunteering\n> > to write one.  So I think whoever chooses to do so has a lot of control\n> > over what is proposed. :)  \n> \n> Rather, they can propose what they want, but they have a lot of\n> tough defending to do on their choice.  Lack of potential harm is\n> much harder to prove than coming up with a single example that\n> harms.\n> \n> I'd rather leave the sleeping dog lie, if we need to encourage\n> people to live in 21st century and step outside US-ASCII to do so,\n> then do that instead.\n\nAs much as I would love to agree Windows is dragging us down here. I\ndon't think there is any other major (or even just not completely\nobscure) platform that does not support UTF-8 in the terminal.\n\nThanks\n\nMichal\n"},{"id":"381710","messageId":"20190903075154.GA18496@instance-1.europe-west6-a.c.vaulted-journal-250706.internal","threadId":"51707","inReplyTo":"xmqq1rwyv6tq.fsf@gitster-ct.c.googlers.com","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Giuseppe Crinò","fromEmail":"giuscri@gmail.com","sentAt":"2019-09-03T07:51:54Z","receivedAt":"2019-09-03T07:51:59Z","isPatch":false,"sender":{"key":"giuscri@gmail.com","avatar":"https://gravatar.com/avatar/0d6b46f6496321ee3646c8712de0b475e225f393a8c72d2c2385d7820b74dd90?d=mp&s=160"},"body":"On Mon, Sep 02, 2019 at 12:25:37PM -0700, Junio C Hamano wrote:\n> I'd rather leave the sleeping dog lie, if we need to encourage\n> people to live in 21st century and step outside US-ASCII to do so,\n> then do that instead.\n\n+1 to let the sleeping dog lie. When you say we should encourage people\nto step outside US-ASCII what do you mean by that?\n\nOn Mon, Sep 02, 2019 at 09:50:48PM +0200, Michal Suchánek wrote:\n> As much as I would love to agree Windows is dragging us down here. I\n> don't think there is any other major (or even just not completely\n> obscure) platform that does not support UTF-8 in the terminal.\n\nWell, I don't know how much Windows is related to that. On my Linux\nmachine my user.name ends with a single quote: I have a US keyboard but\nmy name ends with an \"o grave\" and I can't type it.\n\n\n"},{"id":"381713","messageId":"20190903110323.6e500ca8@naga","threadId":"51707","inReplyTo":"20190903075154.GA18496@instance-1.europe-west6-a.c.vaulted-journal-250706.internal","subject":"Re: [BUG] You can't have single quote in your username","fromName":"Michal Suchánek","fromEmail":"msuchanek@suse.de","sentAt":"2019-09-03T09:03:23Z","receivedAt":"2019-09-03T09:03:27Z","isPatch":false,"sender":{"key":"msuchanek@suse.de","avatar":"https://avatars.githubusercontent.com/u/787652?v=4"},"body":"On Tue, 3 Sep 2019 07:51:54 +0000\nGiuseppe Crinò <giuscri@gmail.com> wrote:\n\n> On Mon, Sep 02, 2019 at 12:25:37PM -0700, Junio C Hamano wrote:\n> > I'd rather leave the sleeping dog lie, if we need to encourage\n> > people to live in 21st century and step outside US-ASCII to do so,\n> > then do that instead.  \n> \n> +1 to let the sleeping dog lie. When you say we should encourage people\n> to step outside US-ASCII what do you mean by that?\n> \n> On Mon, Sep 02, 2019 at 09:50:48PM +0200, Michal Suchánek wrote:\n> > As much as I would love to agree Windows is dragging us down here. I\n> > don't think there is any other major (or even just not completely\n> > obscure) platform that does not support UTF-8 in the terminal.  \n> \n> Well, I don't know how much Windows is related to that. On my Linux\n> machine my user.name ends with a single quote: I have a US keyboard but\n> my name ends with an \"o grave\" and I can't type it.\n\nHave you ever heard about XCompose?\n\nThanks\n\nMichal\n"}]}