Re: [PATCH] blame: Improve parsing for emails with spaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> On Thu, Apr 21, 2011 at 03:07:36PM -0700, Josh Stone wrote:
>
>> One of my git repositories has some old commits where the authors
>> obfuscated their email address as <author at example dot com>.  To
>> handle this, blame needs to look for the leading '<' when scanning
>> to split the "name <email>", rather then only a space delimiter.

Given that we enclose the e-mail inside "<>" pair and excise "<" from
author names in fmt_ident(), I think it makes sense to look for " <" like
this patch does.

> Hmm. That address seems bogus, and I wonder if we should be rejecting it
> at commit time. Still, it is something we may run across in existing
> repositories, so handling it more gracefully makes sense.

Perhaps but within reason.  

What new types of breakages are we proposing to tolerate, what breakages
are we declaring not worth fixing, and what is the price of not loosening
this?  Without this patch, such a broken commit will result in the author
email shown somewhat broken, but the original is already broken to begin
with, and also the entry for the blamed line will come with its commit
object name anyway, so I do not think it is such a big deal.

It would be an entirely different issue if the command barfed and refused
to blame the file.

> Looking over the other places we parse author info, I don't think the
> same problem exists elsewhere. Most other places parse from left to
> right, and just go to the closing ">".

Because fmt_ident() removes "<" or ">" from given email address, I think
it is sufficient.

It would be nice to have an abstraction around the parsing in a way
similar to fmt_ident() is an abstraction around the formatting, but that
would be a separate topic.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]