@matheusbsbs / matheus-bagliano / commits / 6501580ff8
Fork 0

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>

Sergey Organov committed Aug 6, 2020 at 01:08 UTC 6501580ff85fc13e64fe02288dd514d3d898a781
1 file changed +8 -1
revision.c
+8 -1
@@ -2323,8 +2323,15 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
2323 revs->diff = 1;
2324 revs->diffopt.flags.recursive = 1;
2325 revs->diffopt.flags.tree_in_recursive = 1;
2326 - } else if (!strcmp(arg, "-m") || !strcmp(arg, "--diff-merges")) {
2326 + } else if (!strcmp(arg, "-m")) {
2327 revs->ignore_merges = 0;
2328 + } else if ((argcount = parse_long_opt("diff-merges", argv, &optarg))) {
2329 + if (!strcmp(optarg, "off")) {
2330 + revs->ignore_merges = 1;
2331 + } else {
2332 + die(_("unknown value for --diff-merges: %s"), optarg);
2333 + }
2334 + return argcount;
2335 } else if (!strcmp(arg, "--no-diff-merges")) {
2336 revs->ignore_merges = 1;
2337 } else if (!strcmp(arg, "-c")) {