git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] subtree: ignore merge.ff setting

From
Thomas Koutcher via GitGitGadget <gitgitgadget@gmail.com>
Date
Nov 14, 2021, 15:07 UTC
Message-ID
<pull.1139.git.git.1636902454370.gitgitgadget@gmail.com>
From: Thomas Koutcher <thomas.koutcher@online.fr>

When `merge.ff` is set to `only` in .gitconfig, `git subtree pull` will fail with error `fatal: Not possible to fast-forward, aborting.`. This fix ignores the `merge.ff` setting when using `git merge` within subtree.

Signed-off-by: Thomas Koutcher <thomas.koutcher@online.fr>
---
    subtree: ignore merge.ff setting
    
    When merge.ff is set to only in .gitconfig, git subtree pull will fail
    with error fatal: Not possible to fast-forward, aborting.. This fix
    ignores the merge.ff setting when using git merge within subtree.
    
    Signed-off-by: Thomas Koutcher thomas.koutcher@online.fr
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1139%2Fkoutcher%2Fsubtree-merge-ff-fix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1139/koutcher/subtree-merge-ff-fix-v1
Pull-Request: https://github.com/git/git/pull/1139
 contrib/subtree/git-subtree.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 7f767b5c38f..de918d9fb05 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -976,10 +976,10 @@ cmd_merge () {
 
 	if test -n "$arg_addmerge_message"
 	then
-		git merge -Xsubtree="$arg_prefix" \
+		git -c merge.ff= merge -Xsubtree="$arg_prefix" \
 			--message="$arg_addmerge_message" "$rev"
 	else
-		git merge -Xsubtree="$arg_prefix" $rev
+		git -c merge.ff= merge -Xsubtree="$arg_prefix" $rev
 	fi
 }
 

base-commit: 5fbd2fc5997dfa4d4593a862fe729b1e7a89bcf8
-- 
gitgitgadget
Next: Ævar Arnfjörð Bjarmason
Message 1 of 10 in “subtree: ignore merge.ff setting”
  1. subtree: ignore merge.ff settingThomas Koutcher via GitGitGadget, Nov 14, 2021
  2. Ævar Arnfjörð BjarmasonNov 14, 2021
  3. Junio C HamanoNov 14, 2021
  4. subtree: force merge commitThomas Koutcher via GitGitGadget, Nov 14, 2021
  5. Junio C HamanoNov 18, 2021
  6. Thomas KoutcherNov 18, 2021
  7. subtree: force merge commitJohannes Altmanninger, Feb 1, 2022
  8. Junio C HamanoFeb 1, 2022
  9. Johannes AltmanningerFeb 1, 2022
  10. Junio C HamanoFeb 1, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.