Re: [PATCH] commit: search author pattern against mailmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]