diff options
author | Jeff King <peff@peff.net> | 2006-07-23 05:24:18 -0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-07-24 00:04:41 -0700 |
commit | ce43697379ad8ffcaf061a4709489728c1dbe911 (patch) | |
tree | 74db6123dc3f7d8547436f27c5e07b2c2ce81b0d /log-tree.c | |
parent | cbd64afbb3b1ad5433585ac71d94bd0c63270e38 (diff) | |
download | git-ce43697379ad8ffcaf061a4709489728c1dbe911.tar.gz git-ce43697379ad8ffcaf061a4709489728c1dbe911.tar.xz |
Colorize 'commit' lines in log ui
When paging through the output of git-whatchanged, the color cues help to
visually navigate within a diff. However, it is difficult to notice when a
new commit starts, because the commit and log are shown in the "normal"
color. This patch colorizes the 'commit' line, customizable through
diff.colors.commit and defaulting to yellow.
As a side effect, some of the diff color engine (slot enum, get_color) has
become accessible outside of diff.c.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'log-tree.c')
-rw-r--r-- | log-tree.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/log-tree.c b/log-tree.c index 9d8d46fa0..b71cf9ba4 100644 --- a/log-tree.c +++ b/log-tree.c @@ -129,7 +129,8 @@ void show_log(struct rev_info *opt, const char *sep) opt->diffopt.stat_sep = buffer; } } else { - printf("%s%s", + printf("%s%s%s", + diff_get_color(opt->diffopt.color_diff, DIFF_COMMIT), opt->commit_format == CMIT_FMT_ONELINE ? "" : "commit ", diff_unique_abbrev(commit->object.sha1, abbrev_commit)); if (opt->parents) @@ -139,6 +140,8 @@ void show_log(struct rev_info *opt, const char *sep) diff_unique_abbrev(parent->object.sha1, abbrev_commit)); putchar(opt->commit_format == CMIT_FMT_ONELINE ? ' ' : '\n'); + printf("%s", + diff_get_color(opt->diffopt.color_diff, DIFF_RESET)); } /* |