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

Re: [PATCH] doc: pull: fix rebase=false documentation

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jul 22, 2021, 01:24 UTC
Message-ID
<60f8c8c92a215_1d0abb20859@natae.notmuch>
In-Reply-To
<xmqqtukn9p0g.fsf@gitster.g>
Junio C Hamano wrote:
Show 22 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> > Felipe Contreras <felipe.contreras@gmail.com> writes:
> >
> >> diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
> >> index 5c3fb67c01..7f4b2d1982 100644
> >> --- a/Documentation/git-pull.txt
> >> +++ b/Documentation/git-pull.txt
> >> @@ -117,7 +117,7 @@ When set to `preserve` (deprecated in favor of `merges`), rebase with the
> >>  `--preserve-merges` option passed to `git rebase` so that locally created
> >>  merge commits will not be flattened.
> >>  +
> >> -When false, merge the current branch into the upstream branch.
> >> +When false, merge the upstream branch into the current branch.
> >>  +
> >>  When `interactive`, enable the interactive mode of rebase.
> >>  +
> >
> > Looks correct.  Will queue.  Thanks.
> 
> By the way, I'll update the proposed log message to say only that
> the documentation needs to be fixed as it does not say what the
> command does.

Fine by me, although I'd appreciate if you minimize the use of your words and maximize the use of mine.

  The documentation says --rebase=false merges our current branch into
  the upstream branch, and while many people think that's what should
  happen, that's not what actually happens; it's the *opposite*.
  Fix the documentation so that we explain what the code actually does.
> We should be able to fix the inaccuracies in the
> documentation quickly without advocating different behaviour or
> trashing the current behaviour in the proposed log message.

I'm not trashing the current behavior, I'm explaining what the consensus is. I spent several man-days re-reading old threads, and this is the consensus of what should happen:

  1. git pull              # merge HEAD into upstream
  2. git pull origin topic # merge topic into HEAD

Of the people that expressed an opinion, 100% of them stated that what `git pull` does in the first case today is not desirable.

> I also happen to think that "flipping the merge order" is not a good
> thing to do anyway [*1*]; keeping the log message to state just "the
> description does not reflect reality-fix it" has the added benefit
> that we do not have to debate it.
But people have spent many hours debating it already.

Yes, you are correct that if *everyone* followed the topic branch workflow, everything would work correctly, but that's not what happens in reality, in reality people do all kinds of workflows, and wrong merges are pervasive.

Everyone--including Linus, Jeff, and you--agree that there's two different ways of using `git pull`: integrator versus developer.

When a user is doing `git pull` to synchronize changes to push to the same branch, that's a centralized two-way workflow, so he is acting both as an integrator and as a developer, and it's in that particular case that the order of the parents should be reversed. Everyone agrees on that.

When the user the opposite explicitely: `git pull origin master` Linus calls it a "back-merge" [1], and in that case the order of the parents should not be reversed.

This has already been discussed many times, and the problem remains.
[1] https://lore.kernel.org/git/CA+55aFwM0vy+pw-Xv=gA19ULMwAXNPhdO3qR5A3hkMrZKJFNSQ@mail.gmail.com/
-- 
Felipe Contreras
Previous: Junio C HamanoNext: Jeff King
Message 4 of 12 in “doc: pull: fix rebase=false documentation”
  1. doc: pull: fix rebase=false documentationFelipe Contreras, Jul 21, 2021
  2. Junio C HamanoJul 21, 2021
  3. Junio C HamanoJul 22, 2021
  4. Felipe ContrerasJul 22, 2021
  5. Jeff KingJul 23, 2021
  6. Philip OakleyJul 23, 2021
  7. Felipe ContrerasJul 23, 2021
  8. Junio C HamanoJul 23, 2021
  9. Felipe ContrerasJul 23, 2021
  10. Junio C HamanoJul 23, 2021
  11. Felipe ContrerasJul 24, 2021
  12. Felipe ContrerasJul 23, 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.