pretty: add conditional %C?colorname placeholders
commit958e2620c376bcf0165d60b1e5d8baebe6a6dacb
authorWill Palmer <wmpalmer@gmail.com>
Sat, 17 Apr 2010 16:19:55 +0000 (17 17:19 +0100)
committerWill Palmer <wmpalmer@gmail.com>
Sun, 25 Apr 2010 21:42:03 +0000 (25 22:42 +0100)
tree13ad9620a6e4b34dec7c6f231fa945ced605a06a
parentd599e0484f8ebac8cc50e9557a4c3d246826843d
pretty: add conditional %C?colorname placeholders

Many commands are able to colorize, or not, depending on a user's
configuration and whether output is being sent to a terminal. However,
if a user explicitly specifies a --pretty format, color will always be
output, regardless of the destination. This would generally be okay, in
a "do what I tell you, whether or not I should tell you to" sense, but
the assumption fell apart when an alias was defined which may be run in
various contexts: there was no way to specify "use this color, but only
if you normally would display color at all"

Here we add the %C?colorname placeholders which act just as the
%Ccolorname placeholders, with the exception that the pretty_context is
checked to see if color should be used according to configuration

Signed-off-by: Will Palmer <wmpalmer@gmail.com>
Documentation/pretty-formats.txt
builtin/log.c
builtin/rev-list.c
builtin/shortlog.c
commit.h
log-tree.c
pretty.c
shortlog.h
t/t4205-log-pretty-formats.sh [new file with mode: 0755]