git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Herman, Geza" <geza.herman@gmail.com>
To: git@vger.kernel.org
Subject: pull.ff = only vs. branch.<name>.rebase = true problem
Date: Mon, 31 Jan 2022 23:02:37 +0100	[thread overview]
Message-ID: <487ff4cc-7683-8282-d398-cda9230f2eb4@gmail.com> (raw)

Hi,

I saw a similar bug report two months ago ("pull.rebase config option 
broken in 2.33.1"), but it was only about pull.ff=only and pull.rebase. 
My issue is that if "pull.ff = only" is set, then even if 
"branch.<name>.rebase = true", the pull fails because

"fatal: Not possible to fast-forward, aborting."

But because of the branch settings, I'd expect a rebase here.

I modified the script in the previous bug report to show the issue:

--- 8< -------------

git init repo
cd repo

commit() {
     echo $1 >$1
     git add $1
     git commit -m $1
}

git checkout -b local
commit base
commit local

git checkout -b remote HEAD^
commit remote

git checkout local
git config pull.ff only
git config branch.local.rebase true
git pull . remote

--- 8< -------------

This script succeeds with previous versions of git, but with the latest 
one it fails.

My use case is this: I use "pull.ff=only" in my ~/.gitconfig to avoid 
any accidental merges throughout all my repos and branches. But, on 
branches where I do actual work, I usually rebase, so I set 
"branch.<name>.rebase = true" on these branches. Previously this worked, 
but now it has this problem.

Thanks,
Geza Herman

                 reply	other threads:[~2022-01-31 22:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=487ff4cc-7683-8282-d398-cda9230f2eb4@gmail.com \
    --to=geza.herman@gmail.com \
    --cc=git@vger.kernel.org \
    /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).