From: Jeff King Date: Tue, 01 Nov 2011 15:38:03 GMT Subject: Re: imap-send badly handles commit bodies beginning with "From <" 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: > > 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