{"thread":{"id":"52493","subject":"[PATCH] mailinfo: don't discard names under 3 characters","startedAt":"2019-12-20T00:40:02Z","lastAt":"2021-05-16T22:58:57Z","messageCount":5,"participants":["edef","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"388602","messageId":"20191220003948.60272-1-edef@edef.eu","threadId":"52493","inReplyTo":null,"subject":"[PATCH] mailinfo: don't discard names under 3 characters","fromName":"edef","fromEmail":"edef@edef.eu","sentAt":"2019-12-20T00:39:48Z","receivedAt":"2019-12-20T00:40:02Z","isPatch":true,"sender":{"key":"edef@edef.eu","avatar":"https://avatars.githubusercontent.com/u/50854?v=4"},"body":"I sometimes receive patches from people with short mononyms, and in my\ncultural environment these are not uncommon. To my dismay, git-am\ncurrently discards their names, and replaces them with their email\naddresses.\n\nLink: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/\n---\nI'm not *completely* sure there's even a case where `src = email` is \nthe right thing to do, but I'd rather not modify this code more than \nstrictly necessary.\n\n mailinfo.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/mailinfo.c b/mailinfo.c\nindex b395adbdf2..7274232e28 100644\n--- a/mailinfo.c\n+++ b/mailinfo.c\n@@ -19,7 +19,7 @@ static void cleanup_space(struct strbuf *sb)\n static void get_sane_name(struct strbuf *out, struct strbuf *name, struct strbuf *email)\n {\n \tstruct strbuf *src = name;\n-\tif (name->len < 3 || 60 < name->len || strchr(name->buf, '@') ||\n+\tif (!name->len || 60 < name->len || strchr(name->buf, '@') ||\n \t\tstrchr(name->buf, '<') || strchr(name->buf, '>'))\n \t\tsrc = email;\n \telse if (name == out)\n-- \n2.24.1\n\n"},{"id":"388612","messageId":"20191220133740.97560-1-edef@edef.eu","threadId":"52493","inReplyTo":"20191220003948.60272-1-edef@edef.eu","subject":"Re: [PATCH] mailinfo: don't discard names under 3 characters","fromName":"edef","fromEmail":"edef@edef.eu","sentAt":"2019-12-20T13:37:40Z","receivedAt":"2019-12-20T13:37:53Z","isPatch":true,"sender":{"key":"edef@edef.eu","avatar":"https://avatars.githubusercontent.com/u/50854?v=4"},"body":"Seems I forgot something:\n\nSigned-off-by: edef <edef@edef.eu>\n"},{"id":"390779","messageId":"20200130100654.GA840101@coredump.intra.peff.net","threadId":"52493","inReplyTo":"20191220003948.60272-1-edef@edef.eu","subject":"Re: [PATCH] mailinfo: don't discard names under 3 characters","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-01-30T10:06:54Z","receivedAt":"2020-01-30T10:06:56Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Dec 20, 2019 at 12:39:48AM +0000, edef wrote:\n\n> I sometimes receive patches from people with short mononyms, and in my\n> cultural environment these are not uncommon. To my dismay, git-am\n> currently discards their names, and replaces them with their email\n> addresses.\n> \n> Link: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/\n> ---\n> I'm not *completely* sure there's even a case where `src = email` is \n> the right thing to do, but I'd rather not modify this code more than \n> strictly necessary.\n\nI think this makes sense. There's a lot of heuristic voodoo in this old\nmailinfo code, but I think getting people's legitimate short names wrong\nis worse than the likelihood that this is actually helping some\nbroken-parsing case in any meaningful way. I suspect this code predates\nus parsing the headers carefully according to the standard (it looks to\nbe from 2744b2344d on 2005-04-11, which is quite early!).\n\nThe 60-char maximum also seems like something people might run afoul of\nin certain cultures. Is it worth bumping, too?\n\nI think your patch slipped through the cracks, coming as it did over the\nholidays. It's probably worth re-posting it (with your signed-off-by).\n\n-Peff\n"},{"id":"424685","messageId":"20210516150719.49710-1-edef@edef.eu","threadId":"52493","inReplyTo":"20200130100654.GA840101@coredump.intra.peff.net","subject":"[PATCH v2] mailinfo: don't discard names under 3 characters","fromName":"edef","fromEmail":"edef@edef.eu","sentAt":"2021-05-16T15:07:19Z","receivedAt":"2021-05-16T15:07:53Z","isPatch":true,"sender":{"key":"edef@edef.eu","avatar":"https://avatars.githubusercontent.com/u/50854?v=4"},"body":"I sometimes receive patches from people with short mononyms, and in my\ncultural environment these are not uncommon. To my dismay, git-am\ncurrently discards their names, and replaces them with their email\naddresses.\n\nLink: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/\nSigned-off-by: edef <edef@edef.eu>\n---\nRebased and with Signed-off-by this time :)\n\n mailinfo.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/mailinfo.c b/mailinfo.c\nindex 95ce191f38..626228654c 100644\n--- a/mailinfo.c\n+++ b/mailinfo.c\n@@ -19,7 +19,7 @@ static void cleanup_space(struct strbuf *sb)\n static void get_sane_name(struct strbuf *out, struct strbuf *name, struct strbuf *email)\n {\n \tstruct strbuf *src = name;\n-\tif (name->len < 3 || 60 < name->len || strpbrk(name->buf, \"@<>\"))\n+\tif (!name->len || 60 < name->len || strpbrk(name->buf, \"@<>\"))\n \t\tsrc = email;\n \telse if (name == out)\n \t\treturn;\n-- \n2.30.0\n\n"},{"id":"424695","messageId":"xmqq4kf25lso.fsf@gitster.g","threadId":"52493","inReplyTo":"20210516150719.49710-1-edef@edef.eu","subject":"Re: [PATCH v2] mailinfo: don't discard names under 3 characters","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-05-16T22:57:43Z","receivedAt":"2021-05-16T22:58:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"edef <edef@edef.eu> writes:\n\n> I sometimes receive patches from people with short mononyms, and in my\n> cultural environment these are not uncommon. To my dismay, git-am\n> currently discards their names, and replaces them with their email\n> addresses.\n>\n> Link: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/\n> Signed-off-by: edef <edef@edef.eu>\n> ---\n> Rebased and with Signed-off-by this time :)\n>\n>  mailinfo.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/mailinfo.c b/mailinfo.c\n> index 95ce191f38..626228654c 100644\n> --- a/mailinfo.c\n> +++ b/mailinfo.c\n> @@ -19,7 +19,7 @@ static void cleanup_space(struct strbuf *sb)\n>  static void get_sane_name(struct strbuf *out, struct strbuf *name, struct strbuf *email)\n>  {\n>  \tstruct strbuf *src = name;\n> -\tif (name->len < 3 || 60 < name->len || strpbrk(name->buf, \"@<>\"))\n> +\tif (!name->len || 60 < name->len || strpbrk(name->buf, \"@<>\"))\n>  \t\tsrc = email;\n>  \telse if (name == out)\n>  \t\treturn;\n\nWow.  The original of this was from very late in 2019, wasn't it?\n\nThanks for updating; will queue.\n"}]}