git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan Alves <bryanalves@gmail.com>
To: git@vger.kernel.org
Cc: Bryan Alves <bryanalves@gmail.com>, gitster@pobox.com
Subject: [PATCH] merge: --no-ff configuration setting
Date: Sun, 21 Feb 2010 21:59:15 -0500	[thread overview]
Message-ID: <1266807555-86199-1-git-send-email-bryanalves@gmail.com> (raw)

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

             reply	other threads:[~2010-02-22  2:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22  2:59 Bryan Alves [this message]
2010-02-23  5:55 ` [PATCH] merge: --no-ff configuration setting Stephen Boyd
2010-02-23  6:32 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1266807555-86199-1-git-send-email-bryanalves@gmail.com \
    --to=bryanalves@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).