From: Jeff King Date: Fri, 27 May 2016 03:55:54 GMT Subject: Re: [PATCH] format_commit_message: honor `color=auto` for `%C(auto)` Message-ID: <20160527035553.GA24972@sigill.intra.peff.net> In-Reply-To: <20160527034610.GA31629@zoidberg> On Thu, May 26, 2016 at 10:46:10PM -0500, Edward Thomson wrote: > git-log(1) documents that when specifying the `%C(auto)` format > placeholder will "turn on auto coloring on the next %placeholders > until the color is switched again." > > However, when `%C(auto)` is used, the present implementation will turn > colors on unconditionally (even if the color configuration is turned off > for the current context - for example, `--no-color` was specified or the > color is `auto` and the output is not a tty). > > Update `format_commit_one` to examine the current context when a format > string of `%C(auto)` is specified, which ensures that we will not > unconditionally write colors. This brings that behavior in line with > the behavior of `%C(auto,)`, and allows the user the ability > to specify that color should be displayed only when the output is a > tty. > > Additionally, add a test for `%C(auto)` and update the existing tests > for `%C(auto,...)` as they were misidentified as being applicable to > `%C(auto)`. Explanation and the patch look good. > Signed-off-by: Edward Thomson > > Tests from Jeff King. > > Signed-off-by: Jeff King Trailers should all go at the bottom in a single stanza, and should generally be in chronological order (so you got the bits from with an s-o-b, and then you signed off the whole thing). IOW: > Tests from Jeff King. > > Signed-off-by: Jeff King > Signed-off-by: Edward Thomson I suspect Junio can just tweak that while applying, unless there's another reason to re-roll. (Also for anybody watching, Ed did not just make up my signoff; I gave it to him off-list). -Peff