Thread (12 messages) 12 messages, 6 authors, 2016-06-15

Re: Odd merge behaviour involving reverts

flat view

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:45:48


On Thu, 18 Dec 2008, Alan wrote:
I think I know how to fix it.  I am just concerned about having it occur
again if someone else makes the same mistake I did.
I suspect we should warn about reverting merges. I'm surprised we don't 
already. Reverting a merge isn't "wrong", but it's a whole lot more subtle 
than reverting a regular commit.

Reverting a regular commit just effectively undoes what that commit did, 
and is fairly straightforward. But reverting a merge commit also undoes 
the _data_ that the commit changed, but it does absolutely nothing to the 
effects on _history_ that the merge had.

So the merge will still exist, and it will still be seen as joining the 
two branches together, and future merges will see that merge as the last 
shared state - and the revert that reverted the merge brought in will not 
affect that at all.

So a "revert" undoes the data changes, but it's very much _not_ an "undo" 
in the sense that it doesn't undo the effects of a commit on the 
repository history.

So if you think of "revert" as "undo", then you're going to always miss 
this part of reverts. Yes, it undoes the data, but no, it doesn't undo 
history.

			Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help