Re: git rebase behaviour changed?
- From
Martin Langhoff <martin.langhoff@gmail.com>
- Date
- Jan 17, 2006, 08:33 UTC
- Message-ID
- <46a038f90601170033y334d111fjed277fc787a2e523@mail.gmail.com>
- In-Reply-To
- <7v8xtfclyx.fsf@assigned-by-dhcp.cox.net>
On 1/17/06, Junio C Hamano <junkio@cox.net> wrote:
> Sorry I am always slow but I am a bit slower than I usually am > tonight, and do not understand this part without an > illustration:
My fault. I did have a few bits of paper here on my lap, but gmail's textbox sucks at ascii art...
Show 11 quoted lines
> > master 1---2---3---4---5---A > / / > origin 0---6---7---B > > > A = master head > B = origin head == merge base > > rev-list B..A = 1 2 3 4 5 > rev-list A..B = 6 7
Yep, exacly the example I was thinking about.
(...)
> Among the first list of commit, there is #4 which is a merge. > So we reject. Is that what you meant?
Exactly. We refuse to reset the head and begin the rebase operation, because it looks like operator error.
> By the way, the longer I think about this, the more I agree with > the conclusion of the earlier thread: "if you rebase, do not > merge; if you merge, do not rebase". It is really about picking > the right workflow.
Definitely. But errors and misunderstandings are frequent, and people who haven't thought the process through or aren't that familiar with the internals are very likely to try it.
Refusing to rebase, with a good error msg gives the user a chance to evaluate what to do with the commits. Right now, if I read the situation right, there's a good chance commits 1,2 and 3 will be "lost" once the rebase is complete.
GIT won't literally lose them, someone could run git-fsck and fish out the dangling heads from the repo, and after a bit of spelunking recover them, but it's suddenly a really tricky operation.
cheers,
martin