diff options
author | Sergey Organov <sorganov@gmail.com> | 2020-08-06 01:08:30 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-08-11 14:20:24 -0700 |
commit | 6501580ff85fc13e64fe02288dd514d3d898a781 (patch) | |
tree | d6a8ca363efc5fefefe9060f8ff9bfe3dc7e4d12 | |
parent | doc/git-log: clarify handling of merge commit diffs (diff) | |
download | tgif-6501580ff85fc13e64fe02288dd514d3d898a781.tar.xz |
revision: change "--diff-merges" option to require parameter
--diff-merges=off is the only accepted form for now, a synonym for
--no-diff-merges.
This patch is a preparation for adding more values, as well as supporting
--diff-merges=<parent>, where <parent> is single parent number to output diff
against.
Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | revision.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/revision.c b/revision.c index 669bc85669..417659cfcb 100644 --- a/revision.c +++ b/revision.c @@ -2323,8 +2323,15 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg revs->diff = 1; revs->diffopt.flags.recursive = 1; revs->diffopt.flags.tree_in_recursive = 1; - } else if (!strcmp(arg, "-m") || !strcmp(arg, "--diff-merges")) { + } else if (!strcmp(arg, "-m")) { revs->ignore_merges = 0; + } else if ((argcount = parse_long_opt("diff-merges", argv, &optarg))) { + if (!strcmp(optarg, "off")) { + revs->ignore_merges = 1; + } else { + die(_("unknown value for --diff-merges: %s"), optarg); + } + return argcount; } else if (!strcmp(arg, "--no-diff-merges")) { revs->ignore_merges = 1; } else if (!strcmp(arg, "-c")) { |