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

Re: Limitiations of git rebase --preserve-merges --interactive

From
Stefan Beller <sbeller@google.com>
Date
Sep 22, 2016, 20:54 UTC
Message-ID
<CAGZ79kYoFH0dbQwvL_2JOtd8aybH8MKCtzy+p_88+QykVTGUtg@mail.gmail.com>
In-Reply-To
<20160922194848.GB6641@ikke.info>
On Thu, Sep 22, 2016 at 12:48 PM, Kevin Daudt <me@ikke.info> wrote:
Show 20 quoted lines
> On Thu, Sep 22, 2016 at 07:33:11PM +0000, Anatoly Borodin wrote:
>> Hi Stefan,
>>
>> this section was added to the manual in the commit
>> cddb42d2c58a9de9b2b5ef68817778e7afaace3e by "Jonathan Nieder"
>> <jrnieder@gmail.com> 6 years ago. Maybe he remembers better?
>>
>
> Just to make it clear, this section explicitly talks about 'bugs' with
> preserve-merges and interactive rebase.  Without the --preserve-merges
> option, those operations works as expected.
>
> The reason, as that section explains, is that it's not possible to store
> the merge structure in the flat todo list. I assume this means git
> internally remembers where the merge commit was, and then restores it
> while rebasing.
>
> Changing the order, or dropping commits might then give unexpected
> results.
>
The commit message may help as well:
    rebase -i -p: document shortcomings
    The rebase --preserve-merges facility presents a list of commits
    in its instruction sheet and uses a separate table to keep
    track of their parents.  Unfortunately, in practice this means
    that with -p after most attempts to rearrange patches, some
    commits have the "wrong" parent and the resulting history is
    rarely what the caller expected.
    Yes, it would be nice to fix that.  But first, add a warning to the
    manual to help the uninitiated understand what is going on.
Previous: Kevin DaudtNext: Stefan Haller
Message 4 of 15 in “Limitiations of git rebase --preserve-merges --interactive”
  1. Stefan HallerSep 20, 2016
  2. Anatoly BorodinSep 22, 2016
  3. Kevin DaudtSep 22, 2016
  4. Stefan BellerSep 22, 2016
  5. Stefan HallerSep 23, 2016
  6. Johannes SchindelinSep 23, 2016
  7. Stefan BellerSep 23, 2016
  8. Anatoly BorodinSep 22, 2016
  9. Anatoly BorodinSep 22, 2016
  10. Stefan BellerSep 22, 2016
  11. Johannes SchindelinSep 23, 2016
  12. Stefan HallerSep 23, 2016
  13. Junio C HamanoSep 23, 2016
  14. Stefan HallerSep 23, 2016
  15. Johannes SixtSep 23, 2016

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.