From: René Scharfe Date: Wed, 17 Apr 2013 21:22:41 GMT Subject: Re: [PATCH] blame: handle broken commit headers gracefully Message-ID: <516F12A1.9050106@lsrfire.ath.cx> In-Reply-To: <20130417210713.GB635@sigill.intra.peff.net> Am 17.04.2013 23:07, schrieb Jeff King: > On Wed, Apr 17, 2013 at 08:33:54PM +0200, René Scharfe wrote: > >> Minimal patch, test case missing. It's a bit sad that the old commit >> parser of blame handled Ivan's specific corruption (extra "-<>" after >> email) gracefully because it used the spaces as cutting points instead >> of "<" and ">". > > That may mean there is room for improvement in split_ident_line to > be more resilient in removing cruft. With something like: > > Name -<> 123456789 -0000 > > it would obviously be nice to find the date timestamp there, but I > wonder what the "email" field should return? The full broken string, or > just "email@host"? One way is convenient for overlooking problems in > broken commits, but I would worry about code paths that are using > split_ident_line to verify the quality of the string (like > determine_author_info). It's possible we would need a strict and a > forgiving mode. You can have both; the necessary data is in the struct ident_split: Just check that *mail_end == '>' and mail_end + 1 == date_begin etc. René