summaryrefslogtreecommitdiff
path: root/builtin/rev-list.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-07-13 15:07:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-07-13 19:42:51 (GMT)
commitd75dfb1089d471501f6042341bed647525f6e293 (patch)
treed5a3a8a8816152fb24ebe31328f19d1d5d2e949c /builtin/rev-list.c
parentd8b68686a4cc8a486823dd356ed4dba0e51536ea (diff)
downloadgit-d75dfb1089d471501f6042341bed647525f6e293.zip
git-d75dfb1089d471501f6042341bed647525f6e293.tar.gz
git-d75dfb1089d471501f6042341bed647525f6e293.tar.bz2
rev-list: pass diffopt->use_colors through to pretty-print
When rev-list pretty-prints a commit, it creates a new pretty_print_context and copies items from the rev_info struct. We don't currently copy the "use_color" field, though. Nobody seems to have noticed because the only part of pretty.c that cares is the %C(auto,...) placeholder, and presumably not many people use that with the rev-list plumbing (as opposed to with git-log). It will become more noticeable in a future patch, though, when we start treating all user-format colors as auto-colors (in which case it would become impossible to format colors with rev-list, even with --color=always). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rev-list.c')
-rw-r--r--builtin/rev-list.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 95d84d5..fee10d8 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -122,6 +122,7 @@ static void show_commit(struct commit *commit, void *data)
ctx.date_mode_explicit = revs->date_mode_explicit;
ctx.fmt = revs->commit_format;
ctx.output_encoding = get_log_output_encoding();
+ ctx.color = revs->diffopt.use_color;
pretty_print_commit(&ctx, commit, &buf);
if (buf.len) {
if (revs->commit_format != CMIT_FMT_ONELINE)