From: Junio C Hamano Date: Thu, 30 Jun 2022 23:41:42 GMT Subject: Re: [PATCH 3/3] cat-file: add mailmap support Message-ID: In-Reply-To: <20220630142444.651948-4-siddharthasthana31@gmail.com> Siddharth Asthana 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.