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

Re: rebase preserve-merges: incorrect merge commits

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 8, 2018, 13:56 UTC
Message-ID
<nycvar.QRO.7.76.6.1801081452290.31@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
In-Reply-To
<CAJs94Eas59UxZ+490AUSOuB37i+JBEvbCnGBMVpKi1G469OTbw@mail.gmail.com>
Hi Matwey,
On Mon, 8 Jan 2018, Matwey V. Kornilov wrote:
> I think that rebase preserve-merges algorithm needs further
> improvements. Probably, you already know it.
Yes. preserve-merges is a fundamentally flawed design.
Please have a look here:
	https://github.com/git/git/pull/447

Since we are in a feature freeze in preparation for v2.16.0, I will submit these patch series shortly after v2.16.0 is released.

> As far as I understand the root cause of this that when new merge
> commit is created by rebase it is done simply by git merge
> $new_parents without taking into account any actual state of the
> initial merge commit.

Indeed. preserve-merges does not allow commits to be reordered. (Actually, it *does* allow it, but then fails to handle it correctly.) We even have test cases that mark this as "known breakage".

But really, I do not think it is worth trying to fix the broken design. Better to go with the new recreate-merges. (I am biased, of course, because I invented recreate-merges. But then, I also invented preserve-merges, so ...)

Ciao, Johannes

Previous: Matwey V. KornilovNext: Matwey V. Kornilov
Message 2 of 11 in “rebase preserve-merges: incorrect merge commits”
  1. Matwey V. KornilovJan 8, 2018
  2. Johannes SchindelinJan 8, 2018
  3. Matwey V. KornilovJan 8, 2018
  4. Matwey V. KornilovJan 8, 2018
  5. Johannes SchindelinJan 8, 2018
  6. Matwey V. KornilovJan 8, 2018
  7. Johannes SchindelinJan 8, 2018
  8. Matwey V. KornilovJan 9, 2018
  9. Johannes SchindelinJan 9, 2018
  10. Matwey V. KornilovJan 9, 2018
  11. Johannes SchindelinJan 9, 2018

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.