]> git.ipfire.org Git - thirdparty/git.git/commitdiff
diff-merges: add '--diff-merges=1' as synonym for 'first-parent'
authorSergey Organov <sorganov@gmail.com>
Mon, 21 Dec 2020 15:19:55 +0000 (18:19 +0300)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Dec 2020 21:47:32 +0000 (13:47 -0800)
As we now have --diff-merges={m|c|cc}, add --diff-merges=1 as synonym
for --diff-merges=first-parent, to have shorter mnemonics for it as
well.

Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-merges.c

index 011bfff1f1350198a7867f70f1da4d68415e053c..146bb50316a6808e381610dc7168a3b7cf638275 100644 (file)
@@ -58,7 +58,7 @@ static void set_diff_merges(struct rev_info *revs, const char *optarg)
                return;
        }
 
-       if (!strcmp(optarg, "first-parent"))
+       if (!strcmp(optarg, "1") || !strcmp(optarg, "first-parent"))
                set_first_parent(revs);
        else if (!strcmp(optarg, "m") || !strcmp(optarg, "separate"))
                set_separate(revs);