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

Re: Git is removing . from the last part of user.name

From
Jeff King <peff@peff.net>
Date
Aug 22, 2021, 19:28 UTC
Message-ID
<YSKleNynVrWWyyML@coredump.intra.peff.net>
In-Reply-To
<YSJuS1OoYsqgpF3j@camp.crustytoothpaste.net>
On Sun, Aug 22, 2021 at 03:33:31PM +0000, brian m. carlson wrote:
Show 30 quoted lines
> On 2021-08-22 at 14:19:33, Daniel P. wrote:
> > If user.name's  value has a . as the last character of the last part
> > of the name, git is removing it from commit operations. But git-config
> > shows the .
> > 
> > example:
> > 
> > in .gitconfig:
> > 
> > [user]
> >     name = Daniel P.
> > 
> > 
> > `git config user.name`:
> > 
> > user.name=Daniel P.
> > 
> > 
> > from `git show`:
> > 
> > Author: Daniel P <danpltile@gmail.com>
> 
> Yes, it does appear we do that.  We consider a period to be "crud" and
> strip off trailing crud.  I think we should probably change that, since
> in some places people write their family name first, and so a name like
> “carlson brian m.” might be a thing people might want to write, in
> addition to this particular case.
> 
> In any event, it's not very polite to "correct" people's names for them.
> I myself have certainly run into that often enough.

A lot of this name-cleanup code came from an era where we were inferring names from gecos fields or from hacky email parsing.

I agree that if somebody has given us a definite name via config, we should mostly leave it intact (the exception being syntactic elements like <>). But we may still want to keep some of the "crud" cleanup when we are pulling from those other sources.

OTOH, this crud stuff goes all the way back to 5e5128ed1c (Remove extraneous ',' ';' and '.' characters from the full name gecos field., 2005-04-17). We warn in pretty big letters these days about pulling an ident from gecos, and our rfc822 parsing is more robust than it once was. So it may be time to just retire most of it. The unfortunate thing is we won't know how many people complain until it's released.

On a somewhat lesser note, I'm tempted to say that "." probably was never that useful (compared to say, comma, which is the gecos separator), and we could probably just drop it from the crud list.

-Peff
Previous: brian m. carlsonNext: Jeff King
Message 3 of 15 in “Git is removing . from the last part of user.name”
  1. Daniel P.Aug 22, 2021
  2. brian m. carlsonAug 22, 2021
  3. Jeff KingAug 22, 2021
  4. Jeff KingAug 22, 2021
  5. Junio C HamanoAug 23, 2021
  6. Thomas J. Faughnan Jr.Jul 30, 2023
  7. Junio C HamanoJul 31, 2023
  8. brian m. carlsonJul 31, 2023
  9. ident: don't consider trailing dot crudbrian m. carlson, Jul 31, 2023
  10. Junio C HamanoJul 31, 2023
  11. Junio C HamanoAug 2, 2023
  12. brian m. carlsonAug 2, 2023
  13. Junio C HamanoAug 2, 2023
  14. Thomas J. Faughnan Jr.Jul 31, 2023
  15. Junio C HamanoJul 31, 2023

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.