Re: [PATCH v2 2/3] fetch: refactor ref update status formatting code

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

 



Nguyễn Thái Ngọc Duy  <pclouds@xxxxxxxxx> 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.
--
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]