[PATCH] merge: --no-ff configuration setting

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

 



Add a new configuration option, merge.allowfastforward

When set to false, causes --no-ff to be the default behavior
for merges. When set to true, or not present, the default
behavior is unchanged, and acts like --ff is set.

Signed-off-by: Bryan Alves <bryanalves@xxxxxxxxx>
---
 Documentation/merge-options.txt |    4 +++-
 builtin-merge.c                 |    3 +++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 3b83dba..6638af7 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -14,7 +14,9 @@ inspect and further tweak the merge result before committing.
 	the default behavior of git-merge.
 +
 With --no-ff Generate a merge commit even if the merge
-resolved as a fast-forward.
+resolved as a fast-forward.  --no-ff can be made the
+default behavior with the configuration option
+merge.allowfastforward
 
 --log::
 --no-log::
diff --git a/builtin-merge.c b/builtin-merge.c
index 3aaec7b..a96aaac 100644
--- a/builtin-merge.c
+++ b/builtin-merge.c
@@ -495,6 +495,9 @@ static int git_merge_config(const char *k, const char *v, void *cb)
 		free(buf);
 	}
 
+	if (!strcmp(k, "merge.allowfastforward"))
+		allow_fast_forward = !git_config_bool(k, v);
+
 	if (!strcmp(k, "merge.diffstat") || !strcmp(k, "merge.stat"))
 		show_diffstat = git_config_bool(k, v);
 	else if (!strcmp(k, "pull.twohead"))
-- 
1.6.6.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]