Re: Odd merge behaviour involving reverts
- From
- Alan <alan@clueserver.org>
- Date
- Dec 19, 2008, 00:35 UTC
- Message-ID
- <1229646948.5770.33.camel@rotwang.fnordora.org>
- In-Reply-To
- <alpine.LFD.2.00.0812181614070.14014@localhost.localdomain>
On Thu, 2008-12-18 at 16:21 -0800, Linus Torvalds wrote:
Show 27 quoted lines
> > 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.
So what is the recommended way to undo mistaken merges caught after the fact that will not fubar later merges?