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

Re: git am mangles commit author name.

From
DFDaniel F <nanotube@gmail.com>
Date
Jul 13, 2010, 15:48 UTC
Message-ID
<AANLkTimCjfFh25vbzotufpTnUjfRglzHiQeDzWz8O5RJ@mail.gmail.com>
In-Reply-To
<AANLkTikAcZa5J8XhKKJuDCHY3VMhSRzETv0ZQ34EcjMx@mail.gmail.com>
On 7/13/10, Jay Soffian <jaysoffian@gmail.com> wrote:
Show 22 quoted lines
> 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.
>
> 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.
>

Ah yes, indeed... Well, is there any reason to even have that length sanity check in the first place? If someone wants to be identified with a nick of 1 or 2 chars, what's wrong with that?

I have approximately zero familiarity with various git internals, so not sure if anything else depends on this length checkbeing there... But if not, if it is essentially arbitrary... why add complexity with extra options, instead of removing complexity by simply taking out the minimum length check?

At any rate... seeing as how it is hard-coded at the moment, I guess my immediate solution would be to discuss with my patch submitter about choosing a longer nick :)

Thanks, Daniel

Previous: Jay SoffianNext: Ævar Arnfjörð Bjarmason
Message 5 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.