diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-09-02 17:28:59 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-09-03 22:37:03 -0700 |
commit | f88d225feb117f0429540da90b2552e198fa2e82 (patch) | |
tree | d12ff0bfd8c533bf2987fb84cef72d94e60b51d3 /diff.c | |
parent | ff2549dc9af3fffa8a8285418601d9eab94de7b7 (diff) | |
download | git-f88d225feb117f0429540da90b2552e198fa2e82.tar.gz git-f88d225feb117f0429540da90b2552e198fa2e82.tar.xz |
diff --cumulative is a sub-option of --dirstat
The option used to be implemented as if it is a totally independent one,
but "git diff --cumulative" would not mean anything without "--dirstat".
This makes --cumulative imply --dirstat.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1072,7 +1072,7 @@ static void show_dirstat(struct diff_options *options) dir.alloc = 0; dir.nr = 0; dir.percent = options->dirstat_percent; - dir.cumulative = options->output_format & DIFF_FORMAT_CUMULATIVE; + dir.cumulative = DIFF_OPT_TST(options, DIRSTAT_CUMULATIVE); changed = 0; for (i = 0; i < q->nr; i++) { @@ -2298,6 +2298,7 @@ void diff_setup(struct diff_options *options) options->break_opt = -1; options->rename_limit = -1; options->dirstat_percent = 3; + DIFF_OPT_CLR(options, DIRSTAT_CUMULATIVE); options->context = 3; options->change = diff_change; @@ -2470,8 +2471,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac) options->output_format |= DIFF_FORMAT_SHORTSTAT; else if (opt_arg(arg, 'X', "dirstat", &options->dirstat_percent)) options->output_format |= DIFF_FORMAT_DIRSTAT; - else if (!strcmp(arg, "--cumulative")) - options->output_format |= DIFF_FORMAT_CUMULATIVE; + else if (!strcmp(arg, "--cumulative")) { + options->output_format |= DIFF_FORMAT_DIRSTAT; + DIFF_OPT_SET(options, DIRSTAT_CUMULATIVE); + } else if (!strcmp(arg, "--check")) options->output_format |= DIFF_FORMAT_CHECKDIFF; else if (!strcmp(arg, "--summary")) |