Re: [PATCH] pull: allow branch.<name>.rebase to override pull.ff=only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 22, 2025 at 4:05 PM D. Ben Knoble
<ben.knoble+github@xxxxxxxxx> wrote:
>
> On Tue, Apr 22, 2025 at 3:58 PM D. Ben Knoble
> <ben.knoble+github@xxxxxxxxx> wrote:
> >
> > On Wed, Feb 5, 2025 at 4:14 PM D. Ben Knoble
> > <ben.knoble+github@xxxxxxxxx> wrote:
> > >
> > > On Wed, Feb 5, 2025 at 12:42 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
> > > >
> > > > "D. Ben Knoble" <ben.knoble+github@xxxxxxxxx> 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."

Since I apparently hit Send too fast, dropped the CC list to just add
the reference I repeatedly forgot to paste:

6b37dff17f (pull: introduce a pull.rebase option to enable --rebase, 2011-11-06)





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux