Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorMarkus Heidelberg <markus.heidelberg@web.de>2009-04-25 02:06:47 +0400
committerJunio C Hamano <gitster@pobox.com>2009-04-26 12:37:47 +0400
commita408e0e649b79ede7422bf837a31d281e4188cef (patch)
treeca2cf4f2fe1ea9bd8a366232240be9fa9c6bf639 /diff.c
parentbe66a6c43dcba42c56f66a8706721a76098f8e25 (diff)
diff: do not color --stat output like patch context
The diffstat used the color.diff.plain slot (context text) for coloring filenames and the whole summary line. This didn't look nice and the affected text isn't patch context at all. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/diff.c b/diff.c
index 3ac71686eb..d581d4d9ff 100644
--- a/diff.c
+++ b/diff.c
@@ -839,10 +839,9 @@ static int scale_linear(int it, int width, int max_change)
}
static void show_name(FILE *file,
- const char *prefix, const char *name, int len,
- const char *reset, const char *set)
+ const char *prefix, const char *name, int len)
{
- fprintf(file, " %s%s%-*s%s |", set, prefix, len, name, reset);
+ fprintf(file, " %s%-*s |", prefix, len, name);
}
static void show_graph(FILE *file, char ch, int cnt, const char *set, const char *reset)
@@ -956,7 +955,7 @@ static void show_stats(struct diffstat_t* data, struct diff_options *options)
}
if (data->files[i]->is_binary) {
- show_name(options->file, prefix, name, len, reset, set);
+ show_name(options->file, prefix, name, len);
fprintf(options->file, " Bin ");
fprintf(options->file, "%s%d%s", del_c, deleted, reset);
fprintf(options->file, " -> ");
@@ -966,7 +965,7 @@ static void show_stats(struct diffstat_t* data, struct diff_options *options)
continue;
}
else if (data->files[i]->is_unmerged) {
- show_name(options->file, prefix, name, len, reset, set);
+ show_name(options->file, prefix, name, len);
fprintf(options->file, " Unmerged\n");
continue;
}
@@ -988,7 +987,7 @@ static void show_stats(struct diffstat_t* data, struct diff_options *options)
add = scale_linear(add, width, max_change);
del = scale_linear(del, width, max_change);
}
- show_name(options->file, prefix, name, len, reset, set);
+ show_name(options->file, prefix, name, len);
fprintf(options->file, "%5d%s", added + deleted,
added + deleted ? " " : "");
show_graph(options->file, '+', add, add_c, reset);
@@ -996,8 +995,8 @@ static void show_stats(struct diffstat_t* data, struct diff_options *options)
fprintf(options->file, "\n");
}
fprintf(options->file,
- "%s %d files changed, %d insertions(+), %d deletions(-)%s\n",
- set, total_files, adds, dels, reset);
+ " %d files changed, %d insertions(+), %d deletions(-)\n",
+ total_files, adds, dels);
}
static void show_shortstats(struct diffstat_t* data, struct diff_options *options)