Re: unmerging feature branches

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Alejandro Martinez Ruiz <alex@...>
Cc: martin f krafft <madduck@...>, git discussion list <git@...>
Date: Wednesday, October 31, 2007 - 5:34 pm

On Wed, 31 Oct 2007, Alejandro Martinez Ruiz wrote:

There is only one undo command, and that one we've had since day 1:

	git reset --hard <state-you-want-to-go-back-to>

will happily undo anything at all (including an earlier undo, apart from 
uncommitted dirty tree state, which is gone, gone, gone after that 
"undo" and can not be retrieved).

That's the only real true "undo" with clear semantics - it actually does 
undo the whole history.

But the kind of "undo" you wish for is not really possible. It implies a 
level of semantics that the system just doesn't know or care about. It 
also implies that anything else than the shape of history would matter for 
merging, which is just anathema to everything that makes git good in the 
first place.

That said, in practice, this really seldom does come up. You can often use 
"git revert" as that kind of undo, and when you later do the merge, and 
the other side has fixed up the code, it's (a) likely going to be obvious 
in the conflicts and (b) if the fixes were to infrastructure and you had 
no conflicts, it's really easy to just revert the revert too!

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
unmerging feature branches, martin f krafft, (Tue Oct 23, 11:24 am)
Re: unmerging feature branches, Linus Torvalds, (Tue Oct 23, 12:50 pm)
Re: unmerging feature branches, Junio C Hamano, (Tue Oct 23, 3:33 pm)
Re: unmerging feature branches, Linus Torvalds, (Tue Oct 23, 3:49 pm)
[PATCH] revert/cherry-pick: work on merge commits as well, Junio C Hamano, (Tue Oct 23, 4:33 pm)
Re: unmerging feature branches, martin f krafft, (Tue Oct 23, 1:16 pm)
Re: unmerging feature branches, Linus Torvalds, (Tue Oct 23, 1:40 pm)
Re: unmerging feature branches, Alejandro Martinez Ruiz, (Wed Oct 31, 5:16 pm)
Re: unmerging feature branches, Linus Torvalds, (Wed Oct 31, 5:34 pm)
Re: unmerging feature branches, martin f krafft, (Wed Oct 31, 5:27 pm)
Re: unmerging feature branches, martin f krafft, (Tue Oct 23, 2:08 pm)
Re: unmerging feature branches, Linus Torvalds, (Tue Oct 23, 2:24 pm)
Re: unmerging feature branches, martin f krafft, (Tue Oct 23, 3:17 pm)
Re: unmerging feature branches, Linus Torvalds, (Tue Oct 23, 3:38 pm)
Re: unmerging feature branches, Linus Torvalds, (Tue Oct 23, 3:46 pm)
Re: unmerging feature branches, Matthieu Moy, (Tue Oct 23, 12:19 pm)