aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-08-29 00:16:39 -0700
committerJunio C Hamano <gitster@pobox.com>2008-08-29 00:16:39 -0700
commit445cac18c015809a7fcb4a570d3c6571b1ddaf7d (patch)
tree89eeb8e6618d9eb582ea5bd1a2cf781625ebc001 /diff.c
parente990501312e22cfa910d88dc7143bc4eb3632ae1 (diff)
parent53d1589ff6bd336e3ece39e0a963a3d2a537cf96 (diff)
downloadgit-445cac18c015809a7fcb4a570d3c6571b1ddaf7d.tar.gz
git-445cac18c015809a7fcb4a570d3c6571b1ddaf7d.tar.xz
Merge branch 'maint'
* maint: tutorial: gentler illustration of Alice/Bob workflow using gitk pretty=format: respect date format options make git-shell paranoid about closed stdin/stdout/stderr Document gitk --argscmd flag. Fix '--dirstat' with cross-directory renaming for-each-ref: Allow a trailing slash in the patterns
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 18fa7a712..135dec459 100644
--- a/diff.c
+++ b/diff.c
@@ -1060,6 +1060,13 @@ static long gather_dirstat(FILE *file, struct dirstat_dir *dir, unsigned long ch
return this_dir;
}
+static int dirstat_compare(const void *_a, const void *_b)
+{
+ const struct dirstat_file *a = _a;
+ const struct dirstat_file *b = _b;
+ return strcmp(a->name, b->name);
+}
+
static void show_dirstat(struct diff_options *options)
{
int i;
@@ -1119,6 +1126,7 @@ static void show_dirstat(struct diff_options *options)
return;
/* Show all directories with more than x% of the changes */
+ qsort(dir.files, dir.nr, sizeof(dir.files[0]), dirstat_compare);
gather_dirstat(options->file, &dir, changed, "", 0);
}