From: Felipe Contreras <felipe.contreras@gmail.com>
To: Alex Henrie <alexhenrie24@gmail.com>,
git@vger.kernel.org, gitster@pobox.com, newren@gmail.com
Cc: Alex Henrie <alexhenrie24@gmail.com>
Subject: RE: [PATCH RFC] rebase: respect --ff-only option
Date: Mon, 05 Jul 2021 07:00:07 -0500 [thread overview]
Message-ID: <60e2f44749749_1b8e782081f@natae.notmuch> (raw)
In-Reply-To: <20210705044505.666977-1-alexhenrie24@gmail.com>
Alex Henrie wrote:
> The warning about pulling without specifying how to reconcile divergent
> branches says that after setting pull.rebase to true, --ff-only can
> still be passed on the command line to require a fast-forward. Make that
> actually work.
I don't see any value in doing `git rebase --ff-only`. What is the
difference with `git merge --ff-only`?
Presumably this isn't meant to to be called directly by the user, but
only by `git pull`, so it's trying to address my comment [1]:
> You can also pass --rebase, --no-rebase, or --ff-only on the command
> line to override the configured default per invocation.
Can I?
git -c pull.rebase=true pull --ff-only
`--ff-only` doesn't seem to be overriding the configuration.
Passing --ff-only to `git rebase` doesn't solve the problem I was
pointing out, only half of it.
Sure, now this works:
git -c pull.rebase=true pull --ff-only
But --ff-only is not really overriding anything, now you are passing the
problem along.
Consider it the other way around:
git -c pull.ff=only pull --rebase
Is --rebase overriding anything?
No, now all these three fail:
git -c pull.ff=only pull
git -c pull.ff=only pull --rebase
git -c pull.ff=only pull --merge
This is making the situation even worse.
Junio already made the same mistake [2], and I already pointed out why
that doesn't work [3].
This is what we want:
1. git pull # fail by default unless it's a fast-forward
2. git pull --merge # force a merge (unless it's a fast-forward)
3. git pull --rebase # force a rebase (unless it's a fast-forward)
If you make `git rebase` honor --ff-only, and you make --ff-only the
default, then `git pull --rebase` will *always* fail (unless it's a
fast-forward).
We want this:
git -c pull.ff=only pull --rebase
To *ignore* pull.ff=only, not honor it.
I already explored all the options, which is why I maintain that the
only reasonable option is an orthogonal configuration:
pull.mode=fast-forward
Cheers.
[1] https://lore.kernel.org/git/60d7faaf5311a_b8dfe208bd@natae.notmuch/
[2] https://lore.kernel.org/git/xmqqy2irjy4f.fsf@gitster.c.googlers.com/
[3] https://lore.kernel.org/git/CAMP44s08mEyYqbjOeTeS46CngrbQMqP2=cMr1dtRLLk_BLAq3w@mail.gmail.com/
--
Felipe Contreras
prev parent reply other threads:[~2021-07-05 12:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-05 4:45 [PATCH RFC] rebase: respect --ff-only option Alex Henrie
2021-07-05 8:53 ` Phillip Wood
2021-07-05 9:58 ` Junio C Hamano
2021-07-05 12:09 ` Felipe Contreras
2021-07-05 13:54 ` Phillip Wood
2021-07-07 0:30 ` Felipe Contreras
2021-07-05 15:29 ` Phillip Wood
2021-07-05 16:50 ` Junio C Hamano
2021-07-05 19:23 ` Junio C Hamano
2021-07-05 19:48 ` Alex Henrie
2021-07-06 13:52 ` Phillip Wood
2021-07-06 14:43 ` Ævar Arnfjörð Bjarmason
2021-07-07 1:13 ` Felipe Contreras
2021-07-05 9:27 ` Ævar Arnfjörð Bjarmason
2021-07-05 12:00 ` Felipe Contreras [this message]
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=60e2f44749749_1b8e782081f@natae.notmuch \
--to=felipe.contreras@gmail.com \
--cc=alexhenrie24@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=newren@gmail.com \
/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).