git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "D. Ben Knoble" <ben.knoble+github@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, "Alex Henrie" <alexhenrie24@gmail.com>,
	"Æ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: Tue, 22 Apr 2025 16:05:38 -0400	[thread overview]
Message-ID: <CALnO6CDq5BRogPCcDozTi1NEYL6nCoEDaNkFdq2+1V6vVRy=1g@mail.gmail.com> (raw)
In-Reply-To: <CALnO6CBi-c9U-UskTzjNBH+k8VQybdSshYgs+A3_DRH-iz7zHA@mail.gmail.com>

On Tue, Apr 22, 2025 at 3:58 PM D. Ben Knoble
<ben.knoble+github@gmail.com> wrote:
>
> On Wed, Feb 5, 2025 at 4:14 PM D. Ben Knoble
> <ben.knoble+github@gmail.com> wrote:
> >
> > On Wed, Feb 5, 2025 at 12:42 PM Junio C Hamano <gitster@pobox.com> wrote:
> > >
> > > "D. Ben Knoble" <ben.knoble+github@gmail.com> writes:
> > >
> > > >> So, I dunno.
> > > >
> > > > Agreed that if pull.ff=only is supposed to override all other options
> > > > (except those on the command-line), this might be wrong. And `git pull
> > > > --rebase` works in the scenario I described.
> > >
> > > Yeah, I view --ff-only as a safety measure for the user to say "my
> > > workflow is to make sure I do not have anything locally cooking on
> > > my branch when integrating with the other side, and stop me if I
> > > somehow made a mistake".  If rebase or other options override, the
> > > folks in the rebasing camp, unlike in the merging camp, cannot
> > > benefit from such safety measure, which worries me.
> >
> > 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
> >
> > In other words, something like a pull.merge=ff (or ff-only) meaning to
> > apply the rules I've attempted to describe, in which case I would
> > leave pull.ff unset?
> >
> > I suppose pull.rebase=true is close, but is not quite the same for me
> > (I'd like to be warned when this would imply a non-fast-forward for a
> > main branch, though the "rebasing" logs might be sufficient)…
>
> FWIW, I found some tests that indicate, to me, that I should use
> pull.rebase=true (or merges) + branch.<name>.rebase=false for the case
> I described: https://github.com/git/git/blob/08bdfd453584e489d5a551aecbdcb77584e1b958/t/t5520-pull.sh#L505-L514
>
> So it turns out my itch was already scratched.

I left out the commit reference, whose message described what I think
I originally wanted:

> my main or master branch is typically fast-forward only, while I want my
> topic branches to be rebased; preferably, all of those things happen
> for just "git pull."

  reply	other threads:[~2025-04-22 20:05 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
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 [this message]
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='CALnO6CDq5BRogPCcDozTi1NEYL6nCoEDaNkFdq2+1V6vVRy=1g@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).