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

Re: imap-send badly handles commit bodies beginning with "From <"

From
Jeff King <peff@peff.net>
Date
Nov 1, 2011, 15:38 UTC
Message-ID
<20111101153803.GB5552@sigill.intra.peff.net>
In-Reply-To
<20111030090111.GA1624@jpl.local>
On Sun, Oct 30, 2011 at 10:01:11AM +0100, Magnus Bäck wrote:
Show 14 quoted lines
> > Mbox does have this problem, but I think in this case it is a
> > particularly crappy implementation of mbox in imap-send. Look at
> > imap-send.c:split_msg; it just looks for "From ".
> 
> While there seems to be about a million different implementations of
> mbox creation and parsing, the relevant RFC[0] points to [1] as an
> authoritative source. The latter claims that lines matching "^From "
> denote a message boundary and that lines within a message that match
> the same pattern should be quoted with ">". That would suggest that
> the problem isn't imap-send.c but whatever code produces the mbox
> file in the first place. Of course, if that software isn't part of
> Git I guess we'll have to deal with the situation anyway. And whatever
> the RFCs say, we still need to be as compatible is possible with
> whatever software is out there.

Right. If you properly quote and unquote "From " lines, then mbox can be unambiguous. But many pieces of software don't quote them (including git, I think, but I didn't check), so it's prudent when reading to look for something that actually appears to be a "From" line.

If somebody wants to tackle >From quoting of commit messages in git-format-patch, they can certainly do so. In practice, it doesn't tend to come up (because sane readers expect there to be a date at the end of the line), so nobody has put forth the effort.

-Peff
Previous: Magnus BäckNext: Michael Haggerty
Message 6 of 8 in “imap-send badly handles commit bodies beginning with "From <"”
  1. Andrew EikumOct 28, 2011
  2. Jeff KingOct 28, 2011
  3. Andrew EikumOct 28, 2011
  4. Jeff KingOct 28, 2011
  5. Magnus BäckOct 30, 2011
  6. Jeff KingNov 1, 2011
  7. Michael HaggertyNov 1, 2011
  8. Jeff KingNov 1, 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.