Re: [PATCH] Documentation: suggest "reset --keep" to undo a commit
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 21, 2011, 20:28 UTC
- Message-ID
- <7vbp3aovbi.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20110121191459.GC16325@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 9 quoted lines
>> Please tell a story where keep makes more sense than hard by enhancing the >> explanatory text <1> associated with this section. The current text says >> that the three topmost commit representing what you have recently worked >> so far are all unwanted, strongly hinting that hard is more appropriate >> thing to do than keep, which is not what we want if we are changing the >> example to use keep. > > Maybe the best story would be "you have just explored a blind alley > and decided the last three commits are not a good idea at all", with
That unfortunately does not seem to describe the nature of the local changes at all, which I think is the whole point of this topic to encourage use of --keep over --hard.
Show 7 quoted lines
>> It would be sufficient to just hint that the uncommitted changes that you >> have in your working tree are unrelated to what these three commits wanted >> to do (e.g. you always keep small changes around, such as debugging >> printf's > > That use case is less interesting to me --- it is relatively harmless > to clobber such content.
Actually I think that is the primary use case of the feature, as --keep was done as a parallel to the behaviour of checkout that checks out a different branch while keeping local changes.