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

Re: RFD: fast-import is picky with author names (and maybe it should - but how much so?)

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Nov 9, 2012, 09:28 UTC
Message-ID
<509CCCBC.8010102@drmicha.warpmail.net>
In-Reply-To
<20121108200919.GP15560@sigill.intra.peff.net>
Jeff King venit, vidit, dixit 08.11.2012 21:09:
Show 22 quoted lines
> On Fri, Nov 02, 2012 at 03:43:24PM +0100, Michael J Gruber wrote:
> 
>> It seems that our fast-import is super picky with regards to author
>> names. I've encountered author names like
>>
>> Foo Bar<foo.bar@dev.null>
>> Foo Bar <foo.bar@dev.null
>> foo.bar@dev.null
>>
>> in the self-hosting repo of some other dvcs, and the question is how to
>> translate them faithfully into a git author name.
> 
> It is not just fast-import. Git's author field looks like an rfc822
> address, but it's much simpler. It fundamentally does not allow angle
> brackets in the "name" field, regardless of any quoting. As you noted in
> your followup, we strip them out if you provide them via
> GIT_AUTHOR_NAME.
> 
> I doubt this will change anytime soon due to the compatibility fallout.
> So it is up to generators of fast-import streams to decide how to encode
> what they get from another system (you could come up with an encoding
> scheme that represents angle brackets).

I don't expect our requirements to change. For one thing, I was surprised that git-commit is more tolerant than git-fast-import, but it makes a lot of sense to avoid any behind-the-back conversions in the importer.

Show 26 quoted lines
>> In general, we try to do
>>
>> fullotherdvcsname <none@none>
>>
>> if the other system's entry does not parse as a git author name, but
>> fast-import does not accept either of
>>
>> Foo Bar<foo.bar@dev.null> <none@none>
>> "Foo Bar<foo.bar@dev.null>" <none@none>
>>
>> because of the way it parses for <>. While the above could be easily
>> turned into
>>
>> Foo Bar <foo.bar@dev.null>
>>
>> it would not be a faithful representation of the original commit in the
>> other dvcs.
> 
> I'd think that if a remote system has names with angle brackets and
> email-looking things inside them, we would do better to stick them in
> the email field rather than putting in a useless <none@none>. The latter
> should only be used for systems that lack the information.
> 
> But that is a quality-of-implementation issue for the import scripts
> (and they may even want to have options, just like git-cvsimport allows
> mapping cvs usernames into full identities).

That was more my real concern. In our cvs and svn interfaces, we even encourage the use of author maps. For example, if you use an author map, git-svn errors out if it encounters an svn user name which is not in the map. On the other hand, we can map all (most?) svn user names faithfully without using a map (e.g. to "username <none@none>").

Hg seems to store just anything in the author field ("committer"). The various interfaces that are floating around do some behind-the-back conversion to git format. The more conversions they do, the better they seem to work (no erroring out) but I'm wondering whether it's really a good thing, or whether we should encourage a more diligent approach which requires a user to map non-conforming author names wilfully.

Michael
Previous: Jeff KingNext: Felipe Contreras
Message 4 of 24 in “RFD: fast-import is picky with author names (and maybe it should - but how much so?)”
  1. Michael J GruberNov 2, 2012
  2. Michael J GruberNov 2, 2012
  3. Jeff KingNov 8, 2012
  4. Michael J GruberNov 9, 2012
  5. Felipe ContrerasNov 9, 2012
  6. Michael J GruberNov 10, 2012
  7. Felipe ContrerasNov 10, 2012
  8. A Large Angry SCMNov 10, 2012
  9. Felipe ContrerasNov 11, 2012
  10. A Large Angry SCMNov 11, 2012
  11. Jeff KingNov 11, 2012
  12. Felipe ContrerasNov 11, 2012
  13. Jeff KingNov 11, 2012
  14. Felipe ContrerasNov 11, 2012
  15. Jeff KingNov 12, 2012
  16. Felipe ContrerasNov 12, 2012
  17. Michael J GruberNov 13, 2012
  18. Felipe ContrerasNov 13, 2012
  19. A Large Angry SCMNov 11, 2012
  20. Felipe ContrerasNov 11, 2012
  21. A Large Angry SCMNov 11, 2012
  22. Felipe ContrerasNov 11, 2012
  23. Junio C HamanoNov 12, 2012
  24. Felipe ContrerasNov 12, 2012

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.