Re: [PATCH v6 1/1] sideband: highlight keywords in remote sideband output
From: Eric Sunshine <hidden>
Date: 2018-08-06 18:58:43
On Mon, Aug 6, 2018 at 1:45 PM Han-Wen Nienhuys [off-list ref] wrote:
quoted hunk ↗ jump to hunk
The colorization is controlled with the config setting "color.remote". [...] Helped-by: Duy Nguyen [off-list ref] Signed-off-by: Han-Wen Nienhuys <redacted> ---diff --git a/Documentation/config.txt b/Documentation/config.txt@@ -1263,6 +1263,18 @@ color.push:: +color.remote:: + If set, keywords at the start of the line are highlighted. The + keywords are "error", "warning", "hint" and "success", and are + matched case-insensitively. Maybe set to `always`, `false` (or
s/Maybe/May be/
quoted hunk ↗ jump to hunk
+ `never`) or `auto` (or `true`). If unset, then the value of + `color.ui` is used (`auto` by default).diff --git a/sideband.c b/sideband.c +static void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n) +{ + if (!want_color_stderr(use_sideband_colors())) { + strbuf_add(dest, src, n); + fprintf(stderr, "added: '%s'\n", dest->buf);
Debugging gunk?
quoted hunk ↗ jump to hunk
+ return; + }@@ -96,6 +204,7 @@ int recv_sideband(const char *me, int in_stream, int out) if (outbuf.len) { + fprintf(stderr, "last bit '%s'\n", outbuf.buf);
Debugging gunk?
strbuf_addch(&outbuf, '\n');
xwrite(2, outbuf.buf, outbuf.len);
}