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.