summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Sergey Organov <sorganov@gmail.com>2020-12-21 18:19:51 +0300
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-12-21 13:47:32 -0800
commit8c0ba528bc3c61f4582bf68d3f0cc2a72f5f3792 (patch)
tree2e066a1182411e67351358774c757e774562d6c4
parentdiff-merges: make -m/-c/--cc explicitly mutually exclusive (diff)
downloadtgif-8c0ba528bc3c61f4582bf68d3f0cc2a72f5f3792.tar.xz
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 <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--diff-merges.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/diff-merges.c b/diff-merges.c
index e3c0190ebd..4d22da1795 100644
--- a/diff-merges.c
+++ b/diff-merges.c
@@ -17,6 +17,12 @@ static void set_separate(struct rev_info *revs)
revs->separate_merges = 1;
}
+static void set_first_parent(struct rev_info *revs)
+{
+ set_separate(revs);
+ revs->first_parent_merges = 1;
+}
+
static void set_m(struct rev_info *revs)
{
/*
@@ -44,11 +50,18 @@ static void set_dense_combined(struct rev_info *revs)
static void set_diff_merges(struct rev_info *revs, const char *optarg)
{
- if (!strcmp(optarg, "off")) {
+ if (!strcmp(optarg, "off") || !strcmp(optarg, "none"))
suppress(revs);
- } else {
+ else if (!strcmp(optarg, "first-parent"))
+ set_first_parent(revs);
+ else if (!strcmp(optarg, "separate"))
+ set_separate(revs);
+ else if (!strcmp(optarg, "combined"))
+ set_combined(revs);
+ else if (!strcmp(optarg, "dense-combined"))
+ set_dense_combined(revs);
+ else
die(_("unknown value for --diff-merges: %s"), optarg);
- }
}
/*