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

[BUG] Rebase, squash, and conflicts

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Feb 5, 2008, 21:27 UTC
Message-ID
<alpine.LNX.1.00.0802051618190.13593@iabervon.org>

I think there's a bug in the squash behavior for git rebase -i. Say you've got the following history:

aaaaa introduce an API bbbbb use the API in new code ccccc some unrelated review ddddd fix the API due to review

And you do the following rebase:

pick aaaaa introduce an API squash ddddd fix the API due to review pick bbbbb use the API in new code pick ccccc some unrelated review pick ddddd fix the API due to review

(the last line being because some of the changes don't apply between a and b, so we want to duplicate the commit later, and probably squash it into b, but that's not part of this bug report)

You get a conflict on the second item, which you expected. But when you resolve it, it squashes 3/5 into 2/5, not 2/5 into 1/5. I think this is because rebase --continue isn't noticing that it's a squash that needed help. It seems to work fine to do this in two steps (pick instead of squash, followed by another rebase that does the squash when it's unconflicted), as a workaround.

	-Daniel
*This .sig left intentionally blank*
Message 1 of 1 in “[BUG] Rebase, squash, and conflicts”
  1. Daniel BarkalowFeb 5, 2008

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.