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

Rebasing merge commit fails during --preserve-merges when ancestor merge is deleted

From
JFJohn Feminella <jxf@jxf.me>
Date
Oct 23, 2013, 19:25 UTC
Message-ID
<CAAcFwk5Vd2+SJWQaos9o9UX1Za1yV=oEUWCj1VmD87BQP0u6Fw@mail.gmail.com>

I have this situation and an accompanying sample repository reproducing the issue:

https://gist.github.com/fj/7124501/raw/8d37058c1452379d0ae58bd87b0b9e0380bd80b2/gistfile1.txt
* I would like to rebase and delete a spurious ancestor merge commit
(bbd8966 in the example).
* When I do that, however, a successor merge commit (97ba1d7) that has
the ancestor merge commit (bbd8966) fails with the noted error:

===== error: Commit 97ba1d761f60b901f56766886da4ed678e56abea is a merge but no -m option was given. fatal: cherry-pick failed Could not pick 97ba1d761f60b901f56766886da4ed678e56abea ===== The expected result for me is that a new merge commit that merges 6b8c765 (which now occupies the topological spot of the previous spurious commit, bbd8966) and 11d8b92.

What am I doing wrong here? Is there a way to fix multiple instances of this in a history without doing tedious cherry-picking?

Thanks!
~ jf
Message 1 of 1 in “Rebasing merge commit fails during --preserve-merges when ancestor merge is deleted”
  1. John FeminellaOct 23, 2013

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.