git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH RFC] rebase: respect --ff-only option

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jul 5, 2021, 12:09 UTC
Message-ID
<60e2f68057ebe_1b8e782087d@natae.notmuch>
In-Reply-To
<xmqq8s2lnkta.fsf@gitster.g>
Junio C Hamano wrote:
Show 21 quoted lines
> 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
Previous: Junio C HamanoNext: Phillip Wood
Message 4 of 15 in “rebase: respect --ff-only option”
  1. rebase: respect --ff-only optionAlex Henrie, Jul 5, 2021
  2. Phillip WoodJul 5, 2021
  3. Junio C HamanoJul 5, 2021
  4. Felipe ContrerasJul 5, 2021
  5. Phillip WoodJul 5, 2021
  6. Felipe ContrerasJul 7, 2021
  7. Phillip WoodJul 5, 2021
  8. Junio C HamanoJul 5, 2021
  9. Junio C HamanoJul 5, 2021
  10. Alex HenrieJul 5, 2021
  11. Ævar Arnfjörð BjarmasonJul 6, 2021
  12. Phillip WoodJul 6, 2021
  13. Felipe ContrerasJul 7, 2021
  14. Ævar Arnfjörð BjarmasonJul 5, 2021
  15. Felipe ContrerasJul 5, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.