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

Lost commit during rebase!

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
Mar 20, 2014, 19:37 UTC
Message-ID
<CAHd499CBkuCJvZ+U3GEcnw0UFot5JooZVdj2sHT_3p0s6ScwcQ@mail.gmail.com>

I have a local-only branch with just under 70 commits. I also have merge commits on this branch.

The log of the top few commits on my branch looks like so:
* de651ff       (20 minutes ago) (HEAD, survey) Robert Dailey - WIP:
GOTO implementation
* 2a68a23       (21 minutes ago) Robert Dailey - Move boost::phoenix
include & namespace changes to own header file
* e1cd568       (19 hours ago) Robert Dailey - WIP: GOTO flow changes
* b039bb5       (19 hours ago) Robert Dailey - Remove superfluous
include of own header
* 4bdeb27       (20 hours ago) Robert Dailey - Rename NavigateBackwards()

I had two commits that I wanted to squash and also reorder another one. The command I ran is:

git rebase -pi `git merge-base origin/master survey`

I ran this command with 'survey' branch checked out. Once my editor appears, the last few commits in the file look like so:

pick 4bdeb27 Rename NavigateBackwards() pick b039bb5 Remove superfluous include of own header pick e1cd568 WIP: GOTO flow changes pick 2a68a23 Move boost::phoenix include & namespace changes to own header file pick de651ff WIP: GOTO implementation

I modify the last 3 commits in the file so now it looks like this:

pick 4bdeb27 Rename NavigateBackwards() pick b039bb5 Remove superfluous include of own header pick 2a68a23 Move boost::phoenix include & namespace changes to own header file pick e1cd568 WIP: GOTO flow changes squash de651ff WIP: GOTO implementation

What I did was:
1. Move 2a68a23 back one commit
2. Mark de651ff for squash

After this, I save the file, close, and rebase operations begin. After the rebase is done, my log looks like this:

* 94d06df       (19 hours ago) (HEAD, survey) Robert Dailey - WIP:
GOTO flow changes
* b039bb5       (19 hours ago) Robert Dailey - Remove superfluous
include of own header
* 4bdeb27       (20 hours ago) Robert Dailey - Rename NavigateBackwards()

Notice that the commit with description "Move boost::phoenix include & namespace changes to own header file" is missing! I looked at reflog:

$ git reflog 94d06df HEAD@{0}: rebase -i (finish): returning to refs/heads/survey 94d06df HEAD@{1}: rebase -i (squash): WIP: GOTO flow changes e1cd568 HEAD@{2}: rebase -i (pick): updating HEAD 2a7b27a HEAD@{3}: rebase -i (pick): Move boost::phoenix include & namespace changes to own header file b039bb5 HEAD@{4}: rebase -i (pick): updating HEAD 4bdeb27 HEAD@{5}: rebase -i (pick): updating HEAD 2e40bcd HEAD@{6}: rebase -i (pick): updating HEAD 3ca6bb3 HEAD@{7}: rebase -i (pick): updating HEAD e63b1e5 HEAD@{8}: rebase -i (pick): updating HEAD 4d40c00 HEAD@{9}: rebase -i (pick): updating HEAD ec078c1 HEAD@{10}: rebase -i (pick): updating HEAD de48c5d HEAD@{11}: rebase -i (pick): updating HEAD

It shows that it "picked" the commit that's missing now. Is this a bug or am I not doing something right? I'm using Git for Windows version 1.9.0

Next: Robert Dailey
Message 1 of 2 in “Lost commit during rebase!”
  1. Robert DaileyMar 20, 2014
  2. Robert DaileyMar 20, 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.