Thread (1 message) 1 message, 1 author, 2018-08-20

Re: Re* [PATCH v7 1/1] sideband: highlight keywords in remote sideband output

From: Junio C Hamano <hidden>
Date: 2018-08-20 14:32:12

Han-Wen Nienhuys [off-list ref] writes:
quoted
@@ -84,6 +86,9 @@ static void maybe_colorize_sideband(struct strbuf *dest, const char *src, int n)
        for (i = 0; i < ARRAY_SIZE(keywords); i++) {
                struct keyword_entry *p = keywords + i;
                int len = strlen(p->keyword);
+
+               if (n <= len)
+                       continue;
I would suggest

 if (n < len) continue;
..
if (!strncasecmp(p->keyword, src, len) && (n == len || !isalnum(src[len]))) {

so we colorize a single line that looks like "warning" as well
That's the kind of thing I would have mentioned in the initial
review of the feature, and I do not think it is a bad idea.

I do think it is a bad idea to roll it into this patch, though.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help