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

Re: [PATCH] pull: conflict hint pull.rebase suggestion should offer "merges" vs "true"

From
Alex Henrie <alexhenrie24@gmail.com>
Date
Feb 28, 2023, 20:04 UTC
Message-ID
<CAMMLpeRCKMqVNYvL9i0HGTEKvaACaEyCWCotzKfo-OQW2y_BpQ@mail.gmail.com>
In-Reply-To
<CAMP44s1_Oy8GzoALnvQMJEVRkDB3EBmn4drTyY6T+9BatRpjUA@mail.gmail.com>

On Tue, Feb 28, 2023 at 7:13 AM Felipe Contreras <felipe.contreras@gmail.com> wrote:

Show 49 quoted lines
>
> On Thu, Feb 16, 2023 at 7:33 AM Tao Klerks <tao@klerks.biz> wrote:
> > On Thu, Feb 16, 2023 at 4:22 AM Alex Henrie <alexhenrie24@gmail.com> wrote:
>
> > > Now, this is not to say that there's no room for improvement. I like
> > > the rebase=merges option and I wish everyone knew about it because
> > > there are situations where it really is the best option. I suggest
> > > leaving the existing text alone, but adding an additional paragraph,
> > > something like:
> > >
> > > Note that --rebase or pull.rebase=true will drop existing merge
> > > commits and rebase all of the commits from all of the merged branches.
> > > If you want to rebase but preserve existing merge commits, use
> > > --rebase=merges or pull.rebase=merges instead.
> >
> > My primary motivation with this pull request is to reduce the
> > incidences, out there in the world, of people copy-pasting "git config
> > pull.rebase true" into their command-line, and causing themselves
> > major headaches days or weeks later. The "--rebase=interactive" part
> > is secondary (to my concerns), because it's much less copy-pastable.
>
> That's because the whole approach to the pull.rebase configuration is
> wrong. I explained why multiple times in countless discussions and git
> developers did not listen.
>
> What we need is a pull.mode configuration that is *orthogonal* to
> pull.rebase, then everything just works.
>
> For example, you could have this configuration.
>
>     git config pull.mode merge
>     git config pull.rebase merges
>
> Then doing `git pull --rebase` would do a merges rebase.
>
> This is not possible with the current approach, which I objected to.
>
> Then there's no problem with telling the users to do pull.mode=rebase
> (or whatever), since that doesn't override pull.rebase=merges.
>
> I programmed and explained this precise interaction with rebase=merges
> more than two years ago [1], but nobody listened. For an example of
> how such configuration would look like, see the patches I just sent
> [2].
>
> Cheers.
>
> [1] https://lore.kernel.org/git/20201218211026.1937168-14-felipe.contreras@gmail.com/
> [2] https://lore.kernel.org/git/20230228140236.4175835-1-felipe.contreras@gmail.com/T/#t

I think everybody agrees that the current situation is kind of a mess. For better or for worse, there was no consensus to get away from the current set of config options and introduce something more straightforward, so we keep making incremental evolutionary changes within the current framework.

I didn't include it in my list of things to do, but your email made me realize that the problem with `git pull` not being able to do an interactive rebase that rebases merge commits is also something that needs to be fixed before flipping on "rebase merges" by default. If we add that to the list, I guess it would be step 2.25. It's going to be confusing if `git pull -r` rebases merges but `git pull -ri` does not. One way to solve that would be to make -ri/--rebase=interactive on the command line work with pull.rebase=merges instead of overriding it, and add a separate --(no-)rebase-merges command line option for if the user really does want to override it.

On top of that, either before or at the same time as when the default behavior of `git pull --rebase` changes to rebase merges, the behavior of branch.autoSetupRebase needs to change to match.

-Alex
Previous: Felipe ContrerasNext: Felipe Contreras
Message 33 of 34 in “pull: conflict hint pull.rebase suggestion should offer "merges" vs "true"”
  1. pull: conflict hint pull.rebase suggestion should offer "merges" vs "true"Tao Klerks via GitGitGadget, Feb 5, 2023
  2. Alex HenrieFeb 16, 2023
  3. Tao KlerksFeb 16, 2023
  4. Alex HenrieFeb 17, 2023
  5. Tao KlerksFeb 17, 2023
  6. Alex HenrieFeb 17, 2023
  7. Junio C HamanoFeb 17, 2023
  8. Elijah NewrenFeb 18, 2023
  9. Phillip WoodFeb 18, 2023
  10. Tao KlerksFeb 20, 2023
  11. Phillip WoodFeb 20, 2023
  12. Elijah NewrenFeb 20, 2023
  13. Tao KlerksFeb 21, 2023
  14. Sergey OrganovFeb 22, 2023
  15. Elijah NewrenFeb 24, 2023
  16. Sergey OrganovFeb 24, 2023
  17. Elijah NewrenFeb 24, 2023
  18. Sergey OrganovFeb 25, 2023
  19. Elijah NewrenFeb 25, 2023
  20. Sergey OrganovFeb 26, 2023
  21. Elijah NewrenFeb 27, 2023
  22. Sergey OrganovFeb 27, 2023
  23. Elijah NewrenFeb 28, 2023
  24. Elijah NewrenFeb 20, 2023
  25. Tao KlerksFeb 20, 2023
  26. Elijah NewrenFeb 20, 2023
  27. Alex HenrieFeb 20, 2023
  28. Tao KlerksFeb 21, 2023
  29. Alex HenrieFeb 21, 2023
  30. Tao KlerksFeb 21, 2023
  31. Elijah NewrenFeb 24, 2023
  32. Felipe ContrerasFeb 28, 2023
  33. Alex HenrieFeb 28, 2023
  34. Felipe ContrerasMar 1, 2023

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.