git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git rebase -i -p broken?
@ 2008-10-05 15:30 Avi Kivity
  2008-10-06 15:21 ` [PATCH RFC] rebase--interactive: if preserving merges, use first-parent to limit what is shown Stephen Haberman
  0 siblings, 1 reply; 8+ messages in thread
From: Avi Kivity @ 2008-10-05 15:30 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

Consider this scenario:
- commit some patch (named 'a')
- merge a random branch
- commit a fix to patch a
- since I haven't pushed yet, I want to squash a and a-fix together, to 
prevent bisect problems
- fire up 'git rebase -i -p a^'

Now the problems begin:
- the todo list shows up the branch's commits as well as my current 
branch.  But I don't want to commit the branch's commits in my own 
branch.  Replaying the merge should be enough.  Looks like a missing 
--first-parent somewhere.
- removing the spurious commit from the todo, and moving a-fix after a 
and marking it as a squash action, I get
   Refusing to squash a merge: 51ca22d7afb7433332ae41d0c2e3bab598048c21
  even though that's not a merge
- using git commit --amend instead of squash confuses git in some other way

Attached is a script that generates a test case.  With some $EDITOR 
hacks it can even be convinced to be an automated test case.

All this using 1.6.0.2.

-- 
error compiling committee.c: too many arguments to function


[-- Attachment #2: rebase-merge --]
[-- Type: text/plain, Size: 385 bytes --]

!#/bin/sh -e

git --version
mkdir repo
cd repo
git init
touch a
touch 0
git add 0
git commit -m 'zeroth commit'
git add a
git commit -m 'first commit'
git checkout -b branch
touch b
git add b
git commit -m 'second commit (branch)'
git checkout master
touch c
git add c
git commit -m 'third commit'
git merge branch
touch d
git add d
git commit -m 'fifth commit'
git rebase -i -p HEAD~4

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-10-07 14:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-05 15:30 git rebase -i -p broken? Avi Kivity
2008-10-06 15:21 ` [PATCH RFC] rebase--interactive: if preserving merges, use first-parent to limit what is shown Stephen Haberman
2008-10-07  2:20   ` Stephen Haberman
2008-10-07  6:36     ` Stephen Haberman
2008-10-07 14:38       ` Shawn O. Pearce
2008-10-07  9:57     ` Avi Kivity
2008-10-07 12:07       ` Stephan Beyer
2008-10-07 12:22         ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).