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

3 messages from 2010-02-22 to 2010-02-23. Participants: Bryan Alves, Stephen Boyd, Junio C Hamano.
Thread: https://gitlist.dev/t/22746

## Bryan Alves, 2010-02-22 02:59

Subject: [PATCH] merge: --no-ff configuration setting
Message-ID: <1266807555-86199-1-git-send-email-bryanalves@gmail.com>
URL: https://gitlist.dev/e/1266807555-86199-1-git-send-email-bryanalves%40gmail.com

```
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@gmail.com>
---
 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

```

## Stephen Boyd, 2010-02-23 05:55

Subject: Re: [PATCH] merge: --no-ff configuration setting
Message-ID: <4B836DCE.7010606@gmail.com>
URL: https://gitlist.dev/e/4B836DCE.7010606%40gmail.com
In-Reply-To: <1266807555-86199-1-git-send-email-bryanalves@gmail.com>

```
On 02/21/2010 06:59 PM, Bryan Alves wrote:
> 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.

The subject says --no-ff configuration but the option is for --ff.
Sounds confusing. In other words, shouldn't it be
merge.disallowfastforward or merge.nofastforward? Or maybe the subject
should be "merge: --ff configuration setting"

Also could you just use branch.<name>.mergeoptions and not introduce yet
another config option? Or maybe there's some reasoning why you always
want to have merge commits in your workflow?

Finally if this goes in please add a description to Documentation/config.txt

```

## Junio C Hamano, 2010-02-23 06:32

Subject: Re: [PATCH] merge: --no-ff configuration setting
Message-ID: <7vljekbgyd.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vljekbgyd.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1266807555-86199-1-git-send-email-bryanalves@gmail.com>

```
Bryan Alves <bryanalves@gmail.com> writes:

>  Documentation/merge-options.txt |    4 +++-
>  builtin-merge.c                 |    3 +++

This needs tests to make sure that existing programs that internally use
"git merge" (e.g. "rebase -m", "rebase -i") do not break when the end user
has this configuration set in the repository, in addition to that "merge"
works as expected with and without this configuration variable, with
combinations with the use of relevant command line options.

```
