From 30825178fb72e3664bd1bda7c02c62e300e2e5ce Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 17 Dec 2012 17:56:49 -0500 Subject: 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 . Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- commit.h | 1 + 1 file changed, 1 insertion(+) (limited to 'commit.h') diff --git a/commit.h b/commit.h index 9f2131318d..73fd399b09 100644 --- a/commit.h +++ b/commit.h @@ -89,6 +89,7 @@ struct pretty_print_context { int show_notes; struct reflog_walk_info *reflog_info; const char *output_encoding; + int color; }; struct userformat_want { -- cgit v1.2.3