]> rtime.felk.cvut.cz Git - git.git/commitdiff
Merge branch 'mh/diff-stat-color'
authorJunio C Hamano <gitster@pobox.com>
Mon, 18 May 2009 15:59:54 +0000 (08:59 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 May 2009 15:59:54 +0000 (08:59 -0700)
* mh/diff-stat-color:
  diff: do not color --stat output like patch context

1  2 
diff.c

diff --combined diff.c
index 363dcb9613f5f57a2ae31ea6f803caf44954475a,d581d4d9ff13fc5da1c9857073a0ead1ecfe578b..c67ef63c55a80c6e466c1545e7eb7ffbb58ba1d4
--- 1/diff.c
--- 2/diff.c
+++ b/diff.c
@@@ -839,10 -839,9 +839,9 @@@ static int scale_linear(int it, int wid
  }
  
  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)
@@@ -876,7 -875,7 +875,7 @@@ static void fill_print_name(struct diff
        file->print_name = pname;
  }
  
 -static void show_stats(struct diffstat_tdata, struct diff_options *options)
 +static void show_stats(struct diffstat_t *data, struct diff_options *options)
  {
        int i, len, add, del, adds = 0, dels = 0;
        int max_change = 0, max_len = 0;
                }
  
                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, " -> ");
                        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;
                }
                        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);
                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)
               total_files, adds, dels);
  }
  
 -static void show_numstat(struct diffstat_tdata, struct diff_options *options)
 +static void show_numstat(struct diffstat_t *data, struct diff_options *options)
  {
        int i;