public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: Antoine Pelisse <apelisse@gmail•com>, git <git@vger•kernel.org>
Subject: Re: [PATCH] commit: search author pattern against mailmap
Date: Sat, 24 Aug 2013 22:16:55 -0700	[thread overview]
Message-ID: <xmqqob8ml588.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20130825040122.GA18676@sigill.intra.peff.net> (Jeff King's message of "Sun, 25 Aug 2013 00:01:22 -0400")

Jeff King <peff@peff•net> writes:

> On Sat, Aug 24, 2013 at 04:07:47PM +0200, Antoine Pelisse wrote:
>
>> @@ -945,13 +947,16 @@ static const char *find_author_by_nickname(const char *name)
>>  	av[++ac] = buf.buf;
>>  	av[++ac] = NULL;
>>  	setup_revisions(ac, av, &revs, NULL);
>> +	revs.mailmap = &mailmap;
>> +	read_mailmap(revs.mailmap, NULL);
>> +
>>  	prepare_revision_walk(&revs);
>>  	commit = get_revision(&revs);
>>  	if (commit) {
>>  		struct pretty_print_context ctx = {0};
>>  		ctx.date_mode = DATE_NORMAL;
>>  		strbuf_release(&buf);
>> -		format_commit_message(commit, "%an <%ae>", &buf, &ctx);
>> +		format_commit_message(commit, "%aN <%aE>", &buf, &ctx);
>>  		return strbuf_detach(&buf, NULL);
>>  	}
>>  	die(_("No existing author found with '%s'"), name);
>
> Do we need to clear_mailmap before returning to avoid a leak?

Good question. What I queued yesterday seems to have a call to
clear_mailmap(&mailmap) before that return.

  reply	other threads:[~2013-08-25  5:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23 13:48 [PATCH] git-commit: search author pattern against mailmap Antoine Pelisse
2013-08-23 17:44 ` Junio C Hamano
2013-08-23 18:35   ` Jeff King
2013-08-23 19:03     ` Junio C Hamano
2013-08-23 19:47       ` Antoine Pelisse
2013-08-23 20:44         ` Junio C Hamano
2013-08-24 14:07           ` [PATCH] commit: " Antoine Pelisse
2013-08-25  4:01             ` Jeff King
2013-08-25  5:16               ` Junio C Hamano [this message]
2013-08-25  9:47                 ` Antoine Pelisse
2013-08-25 10:01                 ` Antoine Pelisse
2013-08-25 10:30                   ` Jeff King
2013-08-25 13:37                     ` Antoine Pelisse
2013-08-25 16:51                       ` Jeff King
2013-08-25 20:42                         ` Antoine Pelisse
2013-08-26  5:27                         ` Junio C Hamano
2013-08-26 21:38                           ` 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=xmqqob8ml588.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=apelisse@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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