From: Junio C Hamano Date: Mon, 20 Aug 2018 14:32:07 GMT Subject: Re: Re* [PATCH v7 1/1] sideband: highlight keywords in remote sideband output Message-ID: In-Reply-To: Han-Wen Nienhuys writes: >> @@ -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.