Re: [PATCH 5/8] rebase: introduce the --recreate-merges option
- From
Sergey Organov <sorganov@gmail.com>
- Date
- Feb 7, 2018, 09:47 UTC
- Message-ID
- <876079qggl.fsf@javad.com>
- In-Reply-To
- <CA+P7+xqs=cEC+9LJ9VB4XZU-oS7CX6eQSNSGfPeg-whRCwU1Lg@mail.gmail.com>
Jacob Keller <jacob.keller@gmail.com> writes:
Show 24 quoted lines
> On Tue, Feb 6, 2018 at 10:16 PM, Sergey Organov <sorganov@gmail.com> wrote: >> Johannes Schindelin <johannes.schindelin@gmx.de> writes: >> >> [...] >> >>> +--recreate-merges:: >>> + Recreate merge commits instead of flattening the history by replaying >>> + merges. Merge conflict resolutions or manual amendments to merge >>> + commits are not preserved. >> >> I wonder why you guys still hold on replaying "merge-the-operation" >> instead of replaying "merge-the-result"? The latter, the merge commit >> itself, no matter how exactly it was created in the first place, is the >> most valuable thing git keeps about the merge, and you silently drop it >> entirely! OTOH, git keeps almost no information about >> "merge-the-operation", so it's virtually impossible to reliably replay >> the operation automatically, and yet you try to. >> > > I'm not sure I follow what you mean here? > > You mean that you'd want this to actually attempt to re-create the > original merge including conflict resolutions by taking the contents > of the result?
I mean just cherry-pick the merge the same way all other commits are essentially cherry-picked during rebase. That's what Johannes Sixt did in his patch I was reffering to.
> How do you handle if that result has conflicts? What UX do you present > to the user to handle such conflicts? I don't think the normal 3-way > conflicts would even be possible in this case?
No problem here. It goes exactly the same way as for non-merge commits that are being rebased. You can try it right now using
$ git cherry-pick -m1 <merge_commit>
that will induce conflicts.
The (somewhat tricky) functional difference is only in recording correct additional parents to the final commit, but that part is hidden from the user.
-- Sergey