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

Re: [RFC 0/1] mailinfo: de-quote quoted-pair in header fields

From
Jeff King <peff@peff.net>
Date
Sep 14, 2016, 05:13 UTC
Message-ID
<20160914051305.vphknpsikyxi3hg3@sigill.intra.peff.net>
In-Reply-To
<20160913234612.22806-2-me@ikke.info>
On Wed, Sep 14, 2016 at 01:46:12AM +0200, Kevin Daudt wrote:
Show 10 quoted lines
> diff --git a/t/t5100/quoted-pair.expect b/t/t5100/quoted-pair.expect
> new file mode 100644
> index 0000000..9fe72e9
> --- /dev/null
> +++ b/t/t5100/quoted-pair.expect
> @@ -0,0 +1,5 @@
> +Author: "Author "The Author" Name"
> +Email: somebody@example.com
> +Subject: testing quoted-pair
> +Date: Sun, 25 May 2008 00:38:18 -0700

So obviously this is much better than including the backslashed quotes. But I have to wonder why the first line is not:

  Author: Author "The Author" Name

Who is responsible for stripping out the other quotes? I know that they _do_ get stripped out even in the current code, but it is not clear to me if that is intentional or an accident.

In Git's world-view (e.g., in commit headers), an ident name continues until we get to the "<" of the email (or a "\n" terminates the header line completely). So if mailinfo is converting rfc2822 headers into Git ident, I'd expect it to fully remove any quotes that are not intended to be in the name, and everything after "Author: " up to the newline would become the name.

It's entirely possible I'm missing something subtle about the design of mailinfo, though.

-Peff
Previous: Jeff King
Message 16 of 16 in “git-am includes escape characters from 'From' field”
  1. Swift GeekSep 12, 2016
  2. Jeff KingSep 13, 2016
  3. 0/1 de-quote quoted-strings in mailinfoKevin Daudt, Sep 13, 2016
  4. 0/1 mailinfo: de-quote quoted-pair in header fieldsKevin Daudt, Sep 13, 2016
  5. Junio C HamanoSep 14, 2016
  6. Kevin DaudtSep 14, 2016
  7. Jeff KingSep 14, 2016
  8. Junio C HamanoSep 14, 2016
  9. Kevin DaudtSep 14, 2016
  10. Junio C HamanoSep 14, 2016
  11. Jeff KingSep 14, 2016
  12. Junio C HamanoSep 14, 2016
  13. Jeff KingSep 14, 2016
  14. Kevin DaudtSep 15, 2016
  15. Jeff KingSep 15, 2016
  16. Jeff KingSep 14, 2016

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.