git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "D. Ben Knoble" <ben.knoble+github@gmail.com>
To: Alex Henrie <alexhenrie24@gmail.com>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	git@vger.kernel.org, "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Felipe Contreras" <felipe.contreras@gmail.com>,
	"Patrick Steinhardt" <ps@pks.im>,
	"Elijah Newren" <newren@gmail.com>
Subject: Re: [PATCH] pull: allow branch.<name>.rebase to override pull.ff=only
Date: Mon, 10 Feb 2025 15:26:41 -0500	[thread overview]
Message-ID: <CALnO6CDZ=rq_eZESzi++VFk081ddosHMpKQV4QHNFJbnsOMAzg@mail.gmail.com> (raw)
In-Reply-To: <CAMMLpeQvJUZJuwvK-H=M_FFedpgazGOPH=7wvPCg3U8RrxEtkA@mail.gmail.com>

On Thu, Feb 6, 2025 at 9:36 PM Alex Henrie <alexhenrie24@gmail.com> wrote:
>
> On Tue, Feb 4, 2025 at 8:11 PM D. Ben Knoble
> <ben.knoble+github@gmail.com> wrote:
> >
> > When running "git pull" with the following configuration options, we
> > fail to merge divergent branches:
> >
> > - pull.ff=only
> > - pull.rebase (unset)
> > - branch.<current_branch>.rebase=true
> >
> > Yet it seems that the user intended to make rebase the default for the
> > current branch while using --ff-only for non-rebase pulls.
>
> You make an interesting point. The idea is that more specific options
> override less specific options. In this case, "fast-forward only" is
> more specific than "rebase" (because rebasing might or might not
> fast-forward), but "my branch" is also more specific than "all
> branches". So which option should win? 🤔

Precisely! I think "my branch" is most specific here, but Junio's
argument is (if I understand it) that pull.ff=only is _stronger_,
regardless of specificity.

>
> On Wed, Feb 5, 2025 at 2:14 PM D. Ben Knoble
> <ben.knoble+github@gmail.com> wrote:
>
> > Is there, then, an existing combination that means roughly to treat
> > `git pull` with no other options like this:
> > - if not rebasing, forbid merging and be equivalent to --ff-only
> > - if rebasing is requested (because of branch.name.rebase or --rebase
> > or …?), allow it
>
> I think what we're missing is a branch.<name>.ffOnly option to make a
> particular branch fast-forward only. Such an option would be
> especially useful for the master branch, but you could set it on all
> of your branches except the ones that you want to rebase. We could
> even have a branch.autoSetupFfOnly option to turn on ffOnly
> automatically for new branches.

That is probably something that is missing, and might solve the
problem, but I don't know that these in particular are something I
need (read: want to implement).

How do you (and Junio, and others) feel about
pull.ff=onlyUnlessOverridden? The meaning would be "like --ff-only
except when branch.<name>.rebase says otherwise."

The name of the value can be workshopped (I initially thought of
"override" as a short value, but it may be too short to convey its
intended meaning). Perhaps "onlyOr[Branch]Rebase"?

I think this would be a smaller change that meets my needs without
changing the meaning of ff=only.

>
> -Alex

  reply	other threads:[~2025-02-10 20:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-05  3:06 [PATCH] pull: allow branch.<name>.rebase to override pull.ff=only D. Ben Knoble
2025-02-05 13:08 ` Junio C Hamano
2025-02-05 16:36   ` D. Ben Knoble
2025-02-05 17:42     ` Junio C Hamano
2025-02-05 21:14       ` D. Ben Knoble
2025-02-07  2:35         ` Alex Henrie
2025-02-10 20:26           ` D. Ben Knoble [this message]
2025-02-11  6:55             ` Alex Henrie
2025-04-22 20:03               ` D. Ben Knoble
2025-04-22 19:58         ` D. Ben Knoble
2025-04-22 20:05           ` D. Ben Knoble
2025-04-22 20:07             ` D. Ben Knoble
2025-04-22 20:30               ` 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='CALnO6CDZ=rq_eZESzi++VFk081ddosHMpKQV4QHNFJbnsOMAzg@mail.gmail.com' \
    --to=ben.knoble+github@gmail.com \
    --cc=alexhenrie24@gmail.com \
    --cc=avarab@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.com \
    --cc=ps@pks.im \
    /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).