Thread (1 message) 1 message, 1 author, 2016-06-16

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

From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:43

Nguyễn Thái Ngọc Duy  [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help