Skip to content

Commit 8c0ba52

Browse files
sorganovgitster
authored andcommitted
diff-merges: implement new values for --diff-merges
We first implement new options as exact synonyms for their original counterparts, to get all the infrastructure right, and keep functional improvements for later commits. The following values are implemented: --diff-merges= old equivalent first|first-parent = --first-parent (only format implications) sep|separate = -m comb|combined = -c dense| dense-combined = --cc Signed-off-by: Sergey Organov <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 255a4da commit 8c0ba52

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

diff-merges.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ static void set_separate(struct rev_info *revs)
1717
revs->separate_merges = 1;
1818
}
1919

20+
static void set_first_parent(struct rev_info *revs)
21+
{
22+
set_separate(revs);
23+
revs->first_parent_merges = 1;
24+
}
25+
2026
static void set_m(struct rev_info *revs)
2127
{
2228
/*
@@ -44,11 +50,18 @@ static void set_dense_combined(struct rev_info *revs)
4450

4551
static void set_diff_merges(struct rev_info *revs, const char *optarg)
4652
{
47-
if (!strcmp(optarg, "off")) {
53+
if (!strcmp(optarg, "off") || !strcmp(optarg, "none"))
4854
suppress(revs);
49-
} else {
55+
else if (!strcmp(optarg, "first-parent"))
56+
set_first_parent(revs);
57+
else if (!strcmp(optarg, "separate"))
58+
set_separate(revs);
59+
else if (!strcmp(optarg, "combined"))
60+
set_combined(revs);
61+
else if (!strcmp(optarg, "dense-combined"))
62+
set_dense_combined(revs);
63+
else
5064
die(_("unknown value for --diff-merges: %s"), optarg);
51-
}
5265
}
5366

5467
/*

0 commit comments

Comments
 (0)