[PATCH 1/9] diff-merges: introduce --diff-merges=def

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Introduce the notion of default diff format for merges, and the option
"def" to select it. The default is "separate" and can't yet be
changed, so effectively "dev" is just a synonym for "separate" for
now.

This is in preparation for introducing log.diffMerges configuration
option that will let --diff-merges=def to be configured to any
supported format.

Signed-off-by: Sergey Organov <sorganov@xxxxxxxxx>
---
 diff-merges.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/diff-merges.c b/diff-merges.c
index 146bb50316a6..0887a07cfc67 100644
--- a/diff-merges.c
+++ b/diff-merges.c
@@ -2,6 +2,8 @@
 
 #include "revision.h"
 
+typedef void (*diff_merges_setup_func_t)(struct rev_info *);
+
 static void suppress(struct rev_info *revs)
 {
 	revs->separate_merges = 0;
@@ -19,6 +21,8 @@ static void set_separate(struct rev_info *revs)
 	revs->separate_merges = 1;
 }
 
+static diff_merges_setup_func_t set_to_default = set_separate;
+
 static void set_first_parent(struct rev_info *revs)
 {
 	set_separate(revs);
@@ -66,6 +70,8 @@ static void set_diff_merges(struct rev_info *revs, const char *optarg)
 		set_combined(revs);
 	else if (!strcmp(optarg, "cc") || !strcmp(optarg, "dense-combined"))
 		set_dense_combined(revs);
+	else if (!strcmp(optarg, "def"))
+		set_to_default(revs);
 	else
 		die(_("unknown value for --diff-merges: %s"), optarg);
 
-- 
2.25.1




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux