git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>, Josh Stone <jistone@redhat.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] blame: Improve parsing for emails with spaces
Date: Fri, 29 Apr 2011 11:09:19 -0700	[thread overview]
Message-ID: <7vr58lvsj4.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vvcxxvsz4.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Fri, 29 Apr 2011 10:59:43 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Jeff King <peff@peff.net> 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.

Will queue.  Thanks.

Author: Josh Stone <jistone@redhat.com>
Date:   Thu Apr 21 15:07:36 2011 -0700

    blame: tolerate bogus e-mail addresses a bit better
    
    The names and e-mails are sanitized by fmt_ident() when creating commits,
    so that they do not contain "<" nor ">", and the "committer" and "author"
    lines in the commit object will always be in the form:
    
        ("author" | "committer") name SP "<" email ">" SP timestamp SP zone
    
    When parsing the email part out, the current code looks for SP starting
    from the end of the email part, but the author could obfuscate the address
    as "author at example dot com".
    
    We should instead look for SP followed by "<", to match the logic of the
    side that formats these lines.
    
    Signed-off-by: Josh Stone <jistone@redhat.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>

  reply	other threads:[~2011-04-29 18:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21 22:07 [PATCH] blame: Improve parsing for emails with spaces Josh Stone
2011-04-29 13:11 ` Jeff King
2011-04-29 17:59   ` Junio C Hamano
2011-04-29 18:09     ` Junio C Hamano [this message]
2011-04-29 18:17     ` Josh Stone
2011-04-29 19:13     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vr58lvsj4.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jistone@redhat.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).