Re: [PATCH] commit: search author pattern against mailmap
- From
Jeff King <peff@peff.net>
- Date
- Aug 25, 2013, 04:01 UTC
- Message-ID
- <20130825040122.GA18676@sigill.intra.peff.net>
- In-Reply-To
- <1377353267-3886-1-git-send-email-apelisse@gmail.com>
On Sat, Aug 24, 2013 at 04:07:47PM +0200, Antoine Pelisse wrote:
Show 18 quoted lines
> @@ -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?
I suspect we may be leaking pending commits from the revision walker, too, but I'm not sure we have an easy "clear everything" function there.
-Peff