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

Re: "Problems" with git format-patch --thread email header ordering

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 15, 2019, 16:59 UTC
Message-ID
<CAHk-=whe+R7fkTi0eBnhrBY=_k_du3e5dkNsVe=HgKXLoXekdg@mail.gmail.com>
In-Reply-To
<xmqqk1h09224.fsf@gitster-ct.c.googlers.com>
On Thu, Mar 14, 2019 at 9:47 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
>
> Linus Torvalds <torvalds@linux-foundation.org> writes:
>
> > While it's true that header ordering isn't specified, there's a common
> > "canonical" order that the headers are listed in. To quote rfc822:
> > ...
> >             body must occur AFTER  the  headers.   It  is  recommended
> >             that,  if  present,  headers be sent in the order "Return-
> >             Path", "Received", "Date",  "From",  "Subject",  "Sender",
> >             "To", "cc", etc.
>
> I obviously won't do the last one myself, but if the issue is only
> to swap from and date, then this may be sufficient, perhaps?

I'm not actually sure _what_ the order requirements for gmail are, since gmail itself doesn't seem to honor them. Does the order of the Message-ID header line matter, for example?

I don't think it's the order of the From/Date lines, actually, because google itself doesn't do that.

What Thomas Found out was that the exact same email with
    Message-Id/From/Date/Subject/To
(in that order) does not work, but
    Date/From/Subject/To/Message-Id

does work. Weird and "wonderful". But there might be a lot of other orderings that work or don't.

Having looked through some other emails, I know that
    From/To/Subject/Date/Message-Id
    Subject/To/References/From/Message-ID/Date
also works.  Which makes me suspect that it's the Message-ID line that matters.

But it might be something _really_ odd, and maybe not just ordering at all (ie it might be something where gmail wants to see the "From" line, but only in certain circumstances, and only *then* does it matter if the From line comes before some other line or not.

All we know is
 (a) gmail complains about the normal git format-patch ordering with a
"no From line" bounce
 (b) the same email with just headers re-ordered goes through
I *suspect* it's that Message-ID line, but .... It's very annoying.
               Linus
Previous: Junio C HamanoNext: Julian Andres Klode
Message 3 of 5 in “"Problems" with git format-patch --thread email header ordering”
  1. Linus TorvaldsMar 14, 2019
  2. Junio C HamanoMar 15, 2019
  3. Linus TorvaldsMar 15, 2019
  4. Julian Andres KlodeApr 4, 2019
  5. Junio C HamanoApr 5, 2019

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.