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

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.

Previous: Jeff KingNext: Antoine Pelisse
Message 9 of 17 in “git-commit: search author pattern against mailmap”
  1. git-commit: search author pattern against mailmapAntoine Pelisse, Aug 23, 2013
  2. Junio C HamanoAug 23, 2013
  3. Jeff KingAug 23, 2013
  4. Junio C HamanoAug 23, 2013
  5. Antoine PelisseAug 23, 2013
  6. Junio C HamanoAug 23, 2013
  7. commit: search author pattern against mailmapAntoine Pelisse, Aug 24, 2013
  8. Jeff KingAug 25, 2013
  9. Junio C HamanoAug 25, 2013
  10. Antoine PelisseAug 25, 2013
  11. commit: search author pattern against mailmapAntoine Pelisse, Aug 25, 2013
  12. Jeff KingAug 25, 2013
  13. Antoine PelisseAug 25, 2013
  14. Jeff KingAug 25, 2013
  15. Antoine PelisseAug 25, 2013
  16. Junio C HamanoAug 26, 2013
  17. Jeff KingAug 26, 2013

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.