From: Junio C Hamano Date: Fri, 03 Jun 2016 16:48:26 GMT Subject: Re: [PATCH v2 2/3] fetch: refactor ref update status formatting code Message-ID: In-Reply-To: <20160603110843.15434-3-pclouds@gmail.com> Nguyễn Thái Ngọc Duy writes: > This makes it easier to change the formatting later. And it makes sure > translators cannot mess up format specifiers and break Git. > ... > +static void format_display(struct strbuf *display, char code, > + const char *summary, const char *error, > + const char *remote, const char *local) > +{ > + strbuf_addf(display, "%c %-*s ", code, TRANSPORT_SUMMARY(summary)); > + strbuf_addf(display, "%-*s -> %s", REFCOL_WIDTH, remote, local); > + if (error) > + strbuf_addf(display, " (%s)", error); > +} > + Nice reduction of the code repetition below. Looks very sensible.