[Commented On] D9848: fastexport: committer name should not be quoted

roy (Roy Marples) phabricator at mercurial-scm.org
Fri Jan 22 20:45:25 UTC 2021


roy added a comment.


  Finds the author command
  https://github.com/git/git/blob/7f7ebe054af6d831b999d6c2241b9227c4e4e08d/builtin/fast-import.c#L2689
  
  Which sends the text after the command to parse_ident() here.
  https://github.com/git/git/blob/7f7ebe054af6d831b999d6c2241b9227c4e4e08d/builtin/fast-import.c#L1938
  
  First, it verifies there is an email address in angled brackets.
  Then it creates a string buffer based structure where it places the exact text from the start upto and including closing angled bracket of the email address.
  It then verifies the date and appends it's interpretation of that as well.
  
  Now we go back to continue in the first function to actual use this data in the commit:
  https://github.com/git/git/blob/7f7ebe054af6d831b999d6c2241b9227c4e4e08d/builtin/fast-import.c#L2764
  
  So basically it just stores what it's given from the parse_ident function.
  There is no attempt to parse the users name to remove any quotation added.
  
  As to the specification - where do you need the need to quote?
  All I can find is this
  
    Here <name> is the person’s display name (for example “Com M Itter”) and <email> is the person’s email address (“cm at example.com”). LT and GT are the literal less-than (\x3c) and greater-than (\x3e) symbols. These are required to delimit the email address from the other fields in the line. Note that <name> and <email> are free-form and may contain any sequence of bytes, except LT, GT and LF. <name> is typically UTF-8 encoded.
  
  The quotes here show the value, not that it's quoted - after all, email address uses <>, not "".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D9848/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D9848

To: roy, #hg-reviewers
Cc: durin42, Alphare, joerg.sonnenberger, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210122/35c4bdc5/attachment-0002.html>


More information about the Mercurial-patches mailing list