rebase -p confusion in 1.6.1
- From
Sitaram Chamarty <sitaramc@gmail.com>
- Date
- Jan 15, 2009, 10:39 UTC
- Message-ID
- <slrngmu4j5.e1u.sitaramc@sitaramc.homelinux.net>
Hello all,
While trying to understand "rebase -p", I came across some very unexpected behaviour that made me throw in the towel and ask for help!
The outputs I got really confused me. Before the "rebase
-p", the tree looked like
* 78ffda9... (refs/heads/work) b4
* be1e3a4... b3
* cd8d893... Merge branch 'master' into work
|\
| * 0153c27... (refs/heads/master) a4
| * 74f4387... a3
* | f1b0c1c... b2
* | 2e202d0... b1
|/
* b37ae36... a2
* ed1e1bc... a1But afterward, this is what it looks like -- all the "b" commits are gone!
* 0153c27... (refs/heads/work, refs/heads/master) a4
* 74f4387... a3
* b37ae36... a2
* ed1e1bc... a1What did I do wrong/misunderstand?
Here's how to recreate. Note that "testci" is a shell function and "lg" is a git alias. They are, respectively, (1) testci() { for i; do echo $i > $i; git add $i; git commit -m $i; done; } (2) git config alias.lg log --graph --pretty=oneline --abbrev-commit --decorate
git init
testci a1 a2
git checkout -b work
testci b1 b2
git checkout master
testci a3 a4
git checkout work
git merge master
testci b3 b4
git --no-pager lg # graph before rebase -p
git rebase -p master
git --no-pager lg # graph after rebase -p