git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>,
	Phillip Wood <phillip.wood123@gmail.com>
Cc: Alex Henrie <alexhenrie24@gmail.com>,
	git@vger.kernel.org, newren@gmail.com
Subject: Re: [PATCH RFC] rebase: respect --ff-only option
Date: Mon, 05 Jul 2021 07:09:36 -0500	[thread overview]
Message-ID: <60e2f68057ebe_1b8e782087d@natae.notmuch> (raw)
In-Reply-To: <xmqq8s2lnkta.fsf@gitster.g>

Junio C Hamano wrote:
> Phillip Wood <phillip.wood123@gmail.com> writes:
> 
> > As I understand it the motivation for this change is to have 'git -c
> > pull.rebase=true pull --ff-only' actually fast forward. Why cant we
> > just change pull not to rebase in that case?
> > ...
> > Is there a use for this outside of 'git pull --ff-only'? I'm far from
> > convinced we want this new option but if we do end up adding it I
> > think it should error out in combination with '-i' or '-x' as '-i'
> > implies the user wants to change the existing commits and '-x' can end
> > up changing them as well.
> >
> > I think this patch addresses a valid problem but it seems to me that
> > the approach taken pushes complexity into rebase to handle a case when
> > pull does not need to invoke rebase in the first place.
> 
> I share the sentiment, but my conclusion would be different.
> 
> Even though we explain that "pull" is _like_ "fetch" followed by
> "merge" (or "rebase"), at the conceptual level, "pull --ff-only"
> should not have to invoke merge or rebase backend.

Indeed. I'm about to send a patch series that adds the
`git fast-forward` command, so `git pull` doesn't even have to call
either of those.

This cleanly separates the logic, except --ff-only remains purely for
`git merge`, and instead there's a new:

  git -c pull.mode=fast-forward pull

Now it's 100% clear what these three do:

  git -c pull.mode=fast-forward pull
  git -c pull.mode=merge pull
  git -c pull.mode=rebase pull

-- 
Felipe Contreras

  reply	other threads:[~2021-07-05 12:09 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 [this message]
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

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=60e2f68057ebe_1b8e782087d@natae.notmuch \
    --to=felipe.contreras@gmail.com \
    --cc=alexhenrie24@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.com \
    --cc=phillip.wood123@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).