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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 29, 2011, 18:09 UTC
Message-ID
<7vr58lvsj4.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vvcxxvsz4.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
> 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>
Previous: Junio C HamanoNext: Josh Stone
Message 4 of 6 in “blame: Improve parsing for emails with spaces”
  1. blame: Improve parsing for emails with spacesJosh Stone, Apr 21, 2011
  2. Jeff KingApr 29, 2011
  3. Junio C HamanoApr 29, 2011
  4. Junio C HamanoApr 29, 2011
  5. Josh StoneApr 29, 2011
  6. Jeff KingApr 29, 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.