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
Junio C Hamano <gitster@pobox.com>
Date
Sep 14, 2016, 19:30 UTC
Message-ID
<xmqqfup2qny9.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160914191759.5unwaq2eequ4pifr@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 16 quoted lines
> On Wed, Sep 14, 2016 at 10:43:18AM -0700, Junio C Hamano wrote:
>
>> I think we can go either way and it does not matter all that much if
>> "mailinfo" changes its output or the reader of "mailinfo" output
>> changes its input--we will either be munging data read from "From:"
>> when producing the "Author:" line, or taking the "Author:" output by
>> mailinfo and removing the quotes.
>
> Yeah, that was the part I was wondering about in my original response.
> What is the output of mailinfo _supposed_ to be, and do we consider that
> at all public (i.e., are there are other tools besides "git am" that
> build on mailinfo)?
>
> At least "am" already does some quote-stripping, so any de-quoting added
> in mailinfo is potentially a regression (if we indeed care about keeping
> the output stable).

Another small thing I am not sure about is if the \ quoting can hide an embedded newline in the author name. Would we end up turning

	From: "Jeff \
            King" <peff@peff.net>
or somesuch into
	Author: Jeff
        King
        Email: peff@peff.net
;-)
> But if we are OK with that, it seems to me that mailinfo is the best
> place to do the de-quoting, because then its output is well-defined:
> everything after "Author:" up to the newline is the name.
There are other things mailinfo does, like turning this
	From: peff@peff.net (Jeff King)
into
	Author: Jeff King
        Email: peff@peff.net
and
	From: Uh "foo" Bar peff@peff.net (Jeff King)
into
	Author: Uh "foo" Bar (Jeff King)
        Email: peff@peff.net
So let's roll the \" -> " into mailinfo.

I am not sure if we also should remove the surrounding "", i.e. we currently do not turn this

	From: "Jeff King" <peff@peff.net>
into this:
	Author: Jeff King
        Email: peff@peff.net

I think we probably should, and remove the one that does so from the reader.

Previous: Jeff KingNext: Jeff King
Message 12 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.