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

git loses a commit after reordering.

From
NONikita Orlov <fatemail@mail.ru>
Date
Apr 27, 2017, 07:43 UTC
Message-ID
<1493278996.239768474@f402.i.mail.ru>
Hello, my name is Nikita (male).
Could you explain this (subject) is a bug or a feature?
I follow Pro Git Reordering Commits (https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) to reorder commits and lose one without any conflict.
I've got git under Windows 10 Enterprise 64-bit installed through Chocolatey.
> choco list -l git

Chocolatey v0.10.5 chocolatey 0.10.5 git 2.12.2.2 gitpad 1.2 msysgit 1.7.10.20120526 4 packages installed.

$ git --version git version 2.12.2.windows.1

Example.
There are two branches:
- master
- feature-branch
feature-branch is on master.
MyPC MINGW64 /path/to/repository (feature-branch)

$ git log -9 --oneline 5045d1eca Merge branch 'feature-3' into 'feature-branch' 006fc549d Done Task 3 a2a52441e Merge branch 'feature-2' into 'feature-branch' e73527115 Done Task 2 f0454685e Merge branch 'feature-1' into 'feature-branch' 3ab82e4c6 Done Task 1 f15037d64 Some independent changes 2 cba3ebb4e Some independent changes 1 bc19473cf Head of master

$ git rebase -i -p master
I change the rebase script from:

pick cba3ebb4e Some independent changes 1 pick f15037d64 Some independent changes 2 pick 3ab82e4c6 Done Task 1 pick f0454685e Merge branch 'feature-1' into 'feature-branch' pick e73527115 Done Task 2 pick a2a52441e Merge branch 'feature-2' into 'feature-branch' pick 006fc549d Done Task 3 pick 5045d1eca Merge branch 'feature-3' into 'feature-branch'

to:

pick f15037d64 Some independent changes 2 pick cba3ebb4e Some independent changes 1 pick 3ab82e4c6 Done Task 1 pick f0454685e Merge branch 'feature-1' into 'feature-branch' pick e73527115 Done Task 2 pick a2a52441e Merge branch 'feature-2' into 'feature-branch' pick 006fc549d Done Task 3 pick 5045d1eca Merge branch 'feature-3' into 'feature-branch'

No any conflict and I see: Successfully rebased and updated refs/heads/feature-branch.

$ git log -9 --oneline 47e579ce0 Merge branch 'feature-3' into 'feature-branch' a7c6b8b8e Done Task 3 5df7ce105 Merge branch 'feature-2' into 'feature-branch' 0197797d7 Done Task 2 e680488fe Merge branch 'feature-1' into 'feature-branch' 731a57580 Done Task 1 10da9cd85 Some independent changes 2 bc19473cf Head of master d91947abd Commit under the head of master

"Some independent changes 1" is missed and its changes are missed as well.
I tried to move another commit to a farther distance below but there was still only one missed commit.
Could you explain it?
Thank you in advance and sorry for my English.
Best, Nikita
Next: Kevin Daudt
Message 1 of 5 in “git loses a commit after reordering.”
  1. Nikita OrlovApr 27, 2017
  2. Kevin DaudtApr 29, 2017
  3. Re[2]: git loses a commit after reordering.Nikita Orlov, May 1, 2017
  4. Junio C HamanoMay 1, 2017
  5. Johannes SchindelinMay 2, 2017

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.