git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH] mailinfo: don't discard names under 3 characters
@ 2019-12-20  0:39 edef
  2019-12-20 13:37 ` edef
  2020-01-30 10:06 ` Jeff King
  0 siblings, 2 replies; 5+ messages in thread
From: edef @ 2019-12-20  0:39 UTC (permalink / raw)
  To: git; +Cc: edef

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-16 22:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-20  0:39 [PATCH] mailinfo: don't discard names under 3 characters edef
2019-12-20 13:37 ` edef
2020-01-30 10:06 ` Jeff King
2021-05-16 15:07   ` [PATCH v2] " edef
2021-05-16 22:57     ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).