From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id D21571F404 for ; Tue, 27 Feb 2018 16:21:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752777AbeB0QV1 (ORCPT ); Tue, 27 Feb 2018 11:21:27 -0500 Received: from mout.gmx.net ([212.227.15.15]:43697 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751943AbeB0QVY (ORCPT ); Tue, 27 Feb 2018 11:21:24 -0500 Received: from [192.168.0.129] ([37.201.195.115]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LpbJm-1eCRIW2GxS-00fT4B; Tue, 27 Feb 2018 17:21:18 +0100 Date: Tue, 27 Feb 2018 17:21:17 +0100 (STD) From: Johannes Schindelin X-X-Sender: virtualbox@MININT-6BKU6QN.europe.corp.microsoft.com To: Jacob Keller cc: Igor Djordjevic , Sergey Organov , Git mailing list , Johannes Sixt , Junio C Hamano Subject: Re: [RFC] Rebasing merges: a jorney to the ultimate solution (Road Clear) In-Reply-To: Message-ID: References: <87y3jtqdyg.fsf@javad.com> User-Agent: Alpine 2.21.1 (DEB 209 2017-03-23) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K0:tXilKFHUm8c614okpqsh/VdLVz8MP+p9oDDn4qbtQyWy2JA/Dd7 KpdLGu6Yo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yWpeHcPUEio+ANuXP3Bnuq Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Jake, On Mon, 26 Feb 2018, Jacob Keller wrote: > On Mon, Feb 26, 2018 at 4:07 PM, Johannes Schindelin > wrote: > > > > On Tue, 20 Feb 2018, Igor Djordjevic wrote: > > > >> I`m really interested in this topic, which seems to (try to) address the > >> only "bad feeling" I had with rebasing merges - being afraid of silently > >> losing amendments by actually trying to "replay" the merge (where > >> additional and possibly important context is missing), instead of really > >> "rebasing" it (somehow). > > > > If those amendments are what you are worried about, why not address them > > specifically? > > > > In other words, rather than performing the equivalent of > > > > git show ^! | git apply > > > > (which would of course completely ignore if the rewritten ^2 > > dropped a patch, amended a patch, or even added a new patch), what you > > really want is to figure out what changes the user made when merging, and > > what merge strategy was used to begin with. > > > > To see what I mean, look at the output of `git show 0fd90daba8`: it shows > > how conflicts were resolved. By necessity, this is more complicated than a > > simple diff: it is *not* as simple as taking a diff between two revisions > > and applying that diff to a third revision. There were (at least) three > > revisions involved in the original merge commit, and recreating that merge > > commit faithfully means to represent the essence of the merge commit > > faithfully enough to be able to replay it on a new set of at least three > > revisions. That can be simplified to two-way diffs only in very, very > > special circumstances, and in all other cases this simplification will > > simply fall on its nose. > > > > If the proposed solution was to extend `git apply` to process combined > > diffs, I would agree that we're on to something. That is not the proposed > > solution, though. > > > > In short: while I am sympathetic to the desire to keep things simple, > > the idea to somehow side-step replaying the original merge seems to be > > *prone* to be flawed. Any system that cannot accommodate > > dropped/changed/added commits on either side of a merge is likely to be > > too limited to be useful. > > > > > The reason Sergey's solution works is because he cherry picks the > merge using each parent first, and then merges the result of those. So > each branch of the merge gets one, and then you merge the result of > those cherry-picks. This preservers amendments and changes properly, > and should result in a good solution. I saw your patch trying to add a minimal example, and I really want to run away screaming. Do you have any way to describe the idea in a simple, 3-5 lines long paragraph? So far, I just know that it is some sort of confusing criss-cross cherry-picking and merging and stuff, but nothing in those steps shouts out to me what the *idea* is. If it would be something like "recreate the old merge, with merge conflicts and all, then generate the diff to the actual tree of the merge commit, then apply that to the newly-generated merge", I would understand. I would still suspect that -s ours would be a hard nut for that method, but I would understand that idea. Thanks, Dscho