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

Re: [PATCH] git-svn: Add a svn-remote.<name>.pushurl config key

From
Jeff King <peff@peff.net>
Date
Apr 8, 2011, 20:54 UTC
Message-ID
<20110408205437.GB16540@sigill.intra.peff.net>
In-Reply-To
<7vmxk033ic.fsf@alter.siamese.dyndns.org>
On Fri, Apr 08, 2011 at 01:13:47PM -0700, Junio C Hamano wrote:
Show 15 quoted lines
> A Tangent.
> 
> >> X-Mailer: git-send-email 1.7.4.2.1.gd6f1f
> >> In-Reply-To: <1302102336-8800-1-git-send-email-asedeno@mit.edu>
> 
> This is not about this particular patch, but the From: address
> git-send-email generates for you does not seem to quote the human readable
> part, even though the name has a "." in it.
> 
> Your mails seem to reach the recipients fine, but I saw my reply to you
> bounce, because "To:" or "Cc:" in my reply end up having the "R." part not
> quoted, like this:
> 
>   (wrong)  To: Alejandro R. Sedeño <asedeno@mit.edu>
>  (correct) To: "Alejandro R. Sedeño" <asedeno@mit.edu>

Hmm. His case has an extra level of confusion, though, because the non-ascii characters all need rfc2047 encoding. So two emails I've seen from him have:

  From: =?UTF-8?B?IkFsZWphbmRybyBSLiBTZWRlw7FvIg==?= <asedeno@MIT.EDU>
  From: =?UTF-8?q?Alejandro=20R=2E=20Sede=C3=B1o?= <asedeno@mit.edu>

where the first is from Icedove (i.e., Thunderbird) and the second is from git-send-email.

The first one contains double-quotes embedded in the encoded portion. The second one (send-email) does not.

But I'm not clear on if that is necessary. I thought that rfc2047 could only encode a "word" in the "phrase" portion in an address header, meaning the parsing should be unambiguous.

That being said, I think we are not quoting in the non-rfc2047 case, anyway, and that is a bug. rfc5322 says this (section 4.1, Miscellaneous obsolete tokens):

  Note: The "period" (or "full stop") character (".") in obs-phrase is
  not a form that was allowed in earlier versions of this or any other
  specification.  Period (nor any other character from specials) was not
  allowed in phrase because it introduced a parsing difficulty
  distinguishing between phrases and portions of an addr-spec (see
  section 4.4).  It appears here because the period character is
  currently used in many messages in the display-name portion of
  addresses, especially for initials in names, and therefore must be
  interpreted properly.

which recognizes this situation. But being in the obsolete section, I think it is saying "you still need to interpret these, but don't generate them". IOW, we should still be generating quotes now.

I think format-patch is totally lacking in this type of quoting. If I do:

  $ git init
  $ git config user.name '<bogus> with "quotes"'
  $ echo contents >foo && git add . && git commit -m foo
  $ git format-patch --stdout --root
  ...
  From: bogus with "quotes <peff@peff.net>

So some of my magic characters are just stripped, and some of them get included, making the output bogus (the stripping of <> actually happens within git, so the commit itself is missing them).

Not that I think a name like that is sane, but probably we should be double-quoting properly anyway, and then the "." case would just fall out.

-Peff
Previous: Michael J GruberNext: Eric Wong
Message 20 of 33 in “[PATCHv2 0/2] a couple of git-svn patches”
  1. Alejandro R. SedeñoApr 4, 2011
  2. 1/2 git-svn: Fix the commit-url config to be the base url, just like the url configAlejandro R. Sedeño, Apr 4, 2011
  3. Eric WongApr 4, 2011
  4. James Y KnightApr 4, 2011
  5. Eric WongApr 4, 2011
  6. Alejandro R. SedeñoApr 5, 2011
  7. git-svn: Add a svn-remote.<name>.pushurl config keyAlejandro R. Sedeño, Apr 5, 2011
  8. Alejandro R. SedeñoApr 5, 2011
  9. Eric WongApr 5, 2011
  10. Michael J GruberApr 6, 2011
  11. Alejandro R. SedeñoApr 6, 2011
  12. Michael J GruberApr 6, 2011
  13. git-svn: Add a svn-remote.<name>.pushurl config keyAlejandro R. Sedeño, Apr 6, 2011
  14. Michael J GruberApr 6, 2011
  15. Alejandro R. SedeñoApr 6, 2011
  16. Michael J GruberApr 6, 2011
  17. git-svn: Add a svn-remote.<name>.pushurl config keyAlejandro R. Sedeño, Apr 8, 2011
  18. Junio C HamanoApr 8, 2011
  19. Michael J GruberApr 8, 2011
  20. Jeff KingApr 8, 2011
  21. Eric WongApr 9, 2011
  22. Michael J GruberApr 6, 2011
  23. Alejandro R. SedeñoApr 6, 2011
  24. 2/2 git-svn: Cache results of running the executable "git config"Alejandro R. Sedeño, Apr 4, 2011
  25. Eric WongApr 4, 2011
  26. Junio C HamanoApr 5, 2011
  27. Jeff KingApr 8, 2011
  28. Junio C HamanoApr 8, 2011
  29. Jeff KingApr 8, 2011
  30. Jeff KingApr 8, 2011
  31. Alejandro R. SedeñoApr 22, 2011
  32. Jeff KingApr 22, 2011
  33. Alejandro R. SedeñoApr 22, 2011

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.