aboutsummaryrefslogtreecommitdiffstats
path: root/combine-diff.c
diff options
context:
space:
mode:
authorBert Wesarg <bert.wesarg@googlemail.com>2009-11-27 07:55:18 +0100
committerJunio C Hamano <gitster@pobox.com>2009-11-28 10:05:44 -0800
commit89cb73a19ac94d15babf77af490fa5db78908234 (patch)
treea5cb2dd04e1cfe72868cb475a12bc50d02f78d8e /combine-diff.c
parent06a4755270b86a2af20a5c1f0d785311472b5223 (diff)
downloadgit-89cb73a19ac94d15babf77af490fa5db78908234.tar.gz
Give the hunk comment its own color
Inspired by the coloring of quilt. Introduce a separate color and paint the hunk comment part, i.e. the name of the function, in a separate color "diff.func" (defaults to plain). Whitespace between hunk header and hunk comment is printed in plain color. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'combine-diff.c')
-rw-r--r--combine-diff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/combine-diff.c b/combine-diff.c
index 5b63af1eeb..61626912e3 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -524,6 +524,7 @@ static void dump_sline(struct sline *sline, unsigned long cnt, int num_parent,
int i;
unsigned long lno = 0;
const char *c_frag = diff_get_color(use_color, DIFF_FRAGINFO);
+ const char *c_func = diff_get_color(use_color, DIFF_FUNCINFO);
const char *c_new = diff_get_color(use_color, DIFF_FILE_NEW);
const char *c_old = diff_get_color(use_color, DIFF_FILE_OLD);
const char *c_plain = diff_get_color(use_color, DIFF_PLAIN);
@@ -588,7 +589,9 @@ static void dump_sline(struct sline *sline, unsigned long cnt, int num_parent,
comment_end = i;
}
if (comment_end)
- putchar(' ');
+ printf("%s%s %s%s", c_reset,
+ c_plain, c_reset,
+ c_func);
for (i = 0; i < comment_end; i++)
putchar(hunk_comment[i]);
}