git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] mailinfo: don't discard names under 3 characters

From
edef <edef@edef.eu>
Date
Dec 20, 2019, 00:39 UTC
Message-ID
<20191220003948.60272-1-edef@edef.eu>

I sometimes receive patches from people with short mononyms, and in my cultural environment these are not uncommon. To my dismay, git-am currently discards their names, and replaces them with their email addresses.

Link: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
---
I'm not *completely* sure there's even a case where `src = email` is 
the right thing to do, but I'd rather not modify this code more than 
strictly necessary.
 mailinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mailinfo.c b/mailinfo.c
index b395adbdf2..7274232e28 100644
--- a/mailinfo.c
+++ b/mailinfo.c
@@ -19,7 +19,7 @@ static void cleanup_space(struct strbuf *sb)
 static void get_sane_name(struct strbuf *out, struct strbuf *name, struct strbuf *email)
 {
 	struct strbuf *src = name;
-	if (name->len < 3 || 60 < name->len || strchr(name->buf, '@') ||
+	if (!name->len || 60 < name->len || strchr(name->buf, '@') ||
 		strchr(name->buf, '<') || strchr(name->buf, '>'))
 		src = email;
 	else if (name == out)
-- 
2.24.1
Next: edef
Message 1 of 5 in “mailinfo: don't discard names under 3 characters”
  1. mailinfo: don't discard names under 3 charactersedef, Dec 20, 2019
  2. edefDec 20, 2019
  3. Jeff KingJan 30, 2020
  4. mailinfo: don't discard names under 3 charactersedef, May 16, 2021
  5. Junio C HamanoMay 16, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.