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

[PATCH RESEND] subtree: force merge commit

From
Johannes Altmanninger <aclopte@gmail.com>
Date
Feb 1, 2022, 17:26 UTC
Message-ID
<20220201172601.262718-1-aclopte@gmail.com>
In-Reply-To
<xmqqpmqy12u0.fsf@gitster.g>
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.`, but the command does want to make merges in these places. Add `--no-ff` argument to `git merge` to enforce this behaviour.

Signed-off-by: Thomas Koutcher <thomas.koutcher@online.fr>
Reviewed-by: Johannes Altmanninger <aclopte@gmail.com>
---
I think this was meant to be queued but forgotten.
Junio C Hamano <gitster@pobox.com> writes:
> Thanks.  I'll drop these two reviewed-by lines while queuing.
Changes since v2: removed/added reviewed-by trailer

BTW is there a good way to tell "git send-email --in-reply-to" to prefill "To:" and "Cc:" based on the message I'm replying to?

 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 71f1fd94bd..1af1d9653e 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -975,10 +975,10 @@ cmd_merge () {
 
 	if test -n "$arg_addmerge_message"
 	then
-		git merge -Xsubtree="$arg_prefix" \
+		git merge --no-ff -Xsubtree="$arg_prefix" \
 			--message="$arg_addmerge_message" "$rev"
 	else
-		git merge -Xsubtree="$arg_prefix" $rev
+		git merge --no-ff -Xsubtree="$arg_prefix" $rev
 	fi
 }
 
-- 
2.35.0.295.gee0e44bcb6
Previous: Thomas KoutcherNext: Junio C Hamano
Message 7 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.