Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: git rebase behaviour changed?

From: Martin Langhoff <hidden>
Date: 2016-06-15 22:42:16

On 1/17/06, Junio C Hamano [off-list ref] 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...
        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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help