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

Apparent bug in git rebase with a merge commit

From
David M. Lloyd <david.lloyd@redhat.com>
Date
Oct 7, 2014, 18:30 UTC
Message-ID
<5434312E.6040407@redhat.com>

If you have a git tree and you merge in another, independent git tree so that they are the same, using a merge strategy like this:

$ git merge importing/master -s recursive -Xours

And if you later on want to rebase this merge commit on a newer upstream for whatever reason, you get something like this:

$ git rebase -s recursive -Xours First, rewinding head to replay your work on top of it... fatal: Could not parse object 'ca59931ee67fc01b4db4278600d3d92aece898f4^' Unknown exit code (128) from command: git-merge-recursive ca59931ee67fc01b4db4278600d3d92aece898f4^ -- HEAD ca59931ee67fc01b4db4278600d3d92aece898f4

The reason this occurs is that the first commit of the newly-merged-in code obviously has no parent, so I guess the search for the common ancestor is going to be doomed to fail.

It is possible that I'm misunderstanding the recursive merge strategy; however if this were the case I'd still expect a human-readable error message explaining my mistake rather than a 128 exit code.

For a workaround I'll just re-create the commit, but I thought I'd report this behavior anyway.

-- 
- DML
Next: Fabian Ruch
Message 1 of 8 in “Apparent bug in git rebase with a merge commit”
  1. David M. LloydOct 7, 2014
  2. rebase -m: Use empty tree base for parentless commitsFabian Ruch, Oct 9, 2014
  3. Junio C HamanoOct 9, 2014
  4. Fabian RuchOct 9, 2014
  5. Junio C HamanoOct 9, 2014
  6. Fabian RuchOct 13, 2014
  7. Derek MooreOct 9, 2014
  8. David M. LloydOct 9, 2014

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.