On Mon, Feb 20, 2023 at 12:03 AM Tao Klerks <tao@xxxxxxxxxx> wrote: > > On Sat, Feb 18, 2023 at 5:39 PM Phillip Wood <phillip.wood123@xxxxxxxxx> wrote: > > > > On 18/02/2023 03:17, Elijah Newren wrote: > > > [...] > > > My personal opinion would be adding such a capability should be step > > > 2.5 in your list, though I suspect that would make Tao unhappy (it's a > > > non-trivial amount of work, unlike the other steps in your list). > > > > I've got a couple of patches[1] that cherry-pick the merge if only one > > of the parents has changed. I've never tried upstreaming them as it is > > only a partial solution to the problem of rebasing merges but that > > approach should work well with "git pull --rebase=merges" as only the > > upstream side will have changed (when rebasing my git integration branch > > with that patch the merges are cherry-picked). They might make a useful > > starting point if anyone wants to try and improve the rebasing of merges. > > > > This is awesome! > > It feels like the first step towards the general strategy that was (I > believe) best described by Buga at > https://public-inbox.org/git/a0cc88d2-bfed-ce7b-1b3f-3c447d2b32da@xxxxxxxxx/ > ! The strategies described by Buga and others in that mega-thread were suboptimal solutions, in my opinion. Johannes went and implemented some and found them wanting; see the thread over at https://lore.kernel.org/git/nycvar.QRO.7.76.6.1804130002090.65@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/. There were follow-ups with an improved strategy in the thread over at https://lore.kernel.org/git/CABPp-BHWVO5VRhr1-Ou60F1wjKzJZ1e_dC01Mmzs+qB9kGayww@xxxxxxxxxxxxxx/ (Note that this route has also independently been discovered and implemented in jj and found to work well, though it does handle conflicts much differently). And I've since improved the strategy further at https://github.com/newren/git/blob/e84f5f3585fd770ed21f398d2ae5f96e90a51b1e/replay-design-notes.txt#L264-L341. However, note that this isn't a case of merely performing the proper series of merges, it needs some specialized logic and some new capabilities at the xdiff level.