Re: [PATCH] commit: search author pattern against mailmap
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 25, 2013, 05:16 UTC
- Message-ID
- <xmqqob8ml588.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20130825040122.GA18676@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 22 quoted lines
> 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.