Subject: Re: [PATCH 3/3] cat-file: add mailmap support

From: Junio C Hamano <[email-masked]>
Date: Thu, 30 Jun 2022 16:41:42 -0700

Siddharth Asthana <[email-masked]> writes:

> +char *replace_idents_using_mailmap(char *object_buf, size_t *size)
> +{
> +	struct strbuf sb = STRBUF_INIT;
> +	strbuf_attach(&sb, object_buf, *size, *size + 1);
> +	rewrite_ident_line(&sb, "\nauthor ", &mailmap);
> +	rewrite_ident_line(&sb, "\ncommitter ", &mailmap);
> +	rewrite_ident_line(&sb, "\ntagger ", &mailmap);

This shows why you want to fix the existing function first before
inflicting its poorly designed API to more callers.  There is no
sensible reason that you have to make three calls to the helper
function.