git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Altmanninger <aclopte@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Thomas Koutcher <thomas.koutcher@online.fr>,
	Johannes Altmanninger <aclopte@gmail.com>
Subject: [PATCH RESEND] subtree: force merge commit
Date: Tue,  1 Feb 2022 18:26:04 +0100	[thread overview]
Message-ID: <20220201172601.262718-1-aclopte@gmail.com> (raw)
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


  parent reply	other threads:[~2022-02-01 17:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-14 15:07 [PATCH] subtree: ignore merge.ff setting Thomas Koutcher via GitGitGadget
2021-11-14 17:54 ` Ævar Arnfjörð Bjarmason
2021-11-14 18:38 ` Junio C Hamano
2021-11-14 21:45 ` [PATCH v2] subtree: force merge commit Thomas Koutcher via GitGitGadget
2021-11-18  4:53   ` Junio C Hamano
2021-11-18  6:06     ` Thomas Koutcher
2022-02-01 17:26     ` Johannes Altmanninger [this message]
2022-02-01 19:19       ` [PATCH RESEND] " Junio C Hamano
2022-02-01 19:53         ` Johannes Altmanninger
2022-02-01 23:20           ` 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20220201172601.262718-1-aclopte@gmail.com \
    --to=aclopte@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=thomas.koutcher@online.fr \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).