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

Re: git am mangles commit author name.

From
Jay Soffian <jaysoffian@gmail.com>
Date
Jul 13, 2010, 15:11 UTC
Message-ID
<AANLkTikAcZa5J8XhKKJuDCHY3VMhSRzETv0ZQ34EcjMx@mail.gmail.com>
In-Reply-To
<AANLkTinPCZ79vwZ9eVeHChgTuFGBrz3ACi_grM28Q5Y-@mail.gmail.com>
On Tue, Jul 13, 2010 at 10:54 AM, Daniel F <nanotube@gmail.com> wrote:
> Apparently, git-am fails when the username is just one word.
And is less than 3 characters.
Show 8 quoted lines
> if i put a space between the b and the c, it works just fine.
>
> However... do you not think that it is still a bug? Is it not quite reasonable
> for a person to want to identify with just a nick, rather than a full
> first and last name?
>
> And more to the immediate point... is there any way i can get git am
> to do what i want? :)

This is happening due to the get_sane_name check in mailinfo.c. The rules for a "sane" name are actually from Linus' original code. From 2744b23 (Start of early patch applicator tools for git., 2005-04-11):

+static char *sanity_check(char *name, char *email)
+{
+       int len = strlen(name);
+       if (len < 3 || len > 60)
+               return email;
+       if (strchr(name, '@') || strchr(name, '<') || strchr(name, '>'))
+               return email;
+       return name;
+}

You could add an option to mailinfo to disable the sanity check and then plumb that option into its various callers.

j.
Previous: Daniel FNext: Daniel F
Message 4 of 10 in “git am mangles commit author name.”
  1. Daniel FJul 13, 2010
  2. Jonathan NiederJul 13, 2010
  3. Daniel FJul 13, 2010
  4. Jay SoffianJul 13, 2010
  5. Daniel FJul 13, 2010
  6. Ævar Arnfjörð BjarmasonJul 13, 2010
  7. Tor ArntsenJul 14, 2010
  8. Ævar Arnfjörð BjarmasonJul 14, 2010
  9. Daniel FJul 16, 2010
  10. Jonathan NiederJul 16, 2010

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.