]> git.ipfire.org Git - thirdparty/git.git/commit - log-tree.c
log --format: teach %C(auto,black) to respect color config
authorJunio C Hamano <gitster@pobox.com>
Mon, 17 Dec 2012 22:56:49 +0000 (17:56 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Dec 2012 01:30:04 +0000 (17:30 -0800)
commit30825178fb72e3664bd1bda7c02c62e300e2e5ce
tree299ae9907e26fca9f2090b17ca387ff8b4aba9fa
parent2581ad5e85f6443b0d2cf6898793662aec47ef10
log --format: teach %C(auto,black) to respect color config

Traditionally, %C(color attr) always emitted the ANSI color
sequence; it was up to the scripts that wanted to conditionally
color their output to omit %C(...) specifier when they do not want
colors.

Optionally allow "auto," to be prefixed to the color, so that the
output is colored iff we would color regular "log" output
(e.g., taking into account color.* and --color command line
options).

Tests and pretty_context bits by Jeff King <peff@peff.net>.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/pretty-formats.txt
commit.h
log-tree.c
pretty.c
t/t6006-rev-list-format.sh