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
Elijah Newren <newren@gmail.com>
Date
Feb 24, 2023, 07:06 UTC
Message-ID
<CABPp-BH2XPB4BN5Oo=VnLav_wvAGGUAyZC4HRHRRmES5k75P1Q@mail.gmail.com>
In-Reply-To
<87a615vkqk.fsf@osv.gnss.ru>
On Wed, Feb 22, 2023 at 6:27 AM Sergey Organov <sorganov@gmail.com> wrote:
Show 6 quoted lines
>
> Tao Klerks <tao@klerks.biz> writes:
>
> > On Sat, Feb 18, 2023 at 5:39 PM Phillip Wood <phillip.wood123@gmail.com> wrote:
> >>
> >> On 18/02/2023 03:17, Elijah Newren wrote:
[...]
Show 15 quoted lines
> I also agree (in particular with Buga) that from the POV of user
> experience the method suggested by Phillip should be superior, as it
> emphasizes the natural dominance of the "current branch", as opposed to
> originally described symmetric method that is more suitable for formal
> analysis than for actual convenient implementation. Yet creating U1' and
> U2' from the original method could be useful for the purpose of checking
> for possible problems with automatic rebase that the user may need to be
> aware of.
>
> The biggest problem here, as I see it, is designing UI that'd make sense
> in the case of conflicts in multiple stages of the suggested algorithms,
> but I think we can simplify it for now by stopping and suggesting blind
> re-merge in case of any conflict but that on rebasing of changes to the
> first parent. Even this would be a huge step forward compared to silent
> drop of merge commits and blindly re-merging of updated parents.
I'm not so sure it's a huge step forward.  Or even a step forward.

Dscho actually implemented the old proposals and tried them out, as mentioned in the threads I linked to. The results on balance were significantly worse to him than just throwing away the previous merge resolution information and redoing the merge from scratch. He really wanted a better solution, but the previous proposals didn't provide it.

This newer approximation, while more careful about only attempting to run in specific cases and having some good ideas to improve the user experience, still builds on the problematic foundations in those old suggestions (namely, cherry-picking merges relative to either of their parents). I think it isn't careful enough about the subset of cases where those problematic foundations can work right.

> > Are there *any* circumstances where the new cherry-picking behavior
> > introduced here wouldn't be the right thing to have happen?

Yes, I can think of one fairly readily: Do an interactive rebase and drop one or more commits on the side-branch being merged. This cherry-picking of merges would reinstate those dropped changes via silently squashing them into the merge commit itself, making for a rather evil merge.

Show 6 quoted lines
> None that I'm aware off, but I admit I'm not familiar with later Elijah
> work on the subject, so I could be mistaken. I only got a sketchy look
> at what Elijah did, and it looks like advanced material to me. I'd
> incline to rather get solid implementation of basics first, probably
> using Phillip method, then consider advanced methods if practice reveals
> demands for further improvements.

That'd be fine if there's another solution that can provide a "solid implementation of the basics"; I've not seen another proposal that can yet.

> I'm afraid that there is no ideal general solution for the problem of
> rebasing merge commits.

Sometimes problems aren't generically solvable. However, sometimes the problem is solvable, but folks so far have only provided solutions built on a faulty basis, or that were only designed for special cases, or that only look at a subset of the problem space.

I think rebasing merges falls into the latter category, and that the prior proposals were just off the mark. Granted, I haven't implemented my proposal yet and I might discover more issues when I do, but I'm optimistic. It just really needs some good uninterrupted time, and my Git time comes in highly interrupted occasional spurts these days (and with new short-term priorities being inserted based on other things that come up on the mailing list and from elsewhere to boot). But I'll get to it one way or another.

Previous: Sergey OrganovNext: Sergey Organov
Message 15 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.