Re: [PATCH] cmd_reset: don't trash uncommitted changes unless told to

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Johannes Schindelin
Date: Wednesday, June 25, 2008 - 3:16 am

Hi,

just to add to Junio's comments:

On Wed, 25 Jun 2008, Boaz Harrosh wrote:


But "reset" _means_ to discard something.

Frankly, we could introduce "git reset --hard --force --really 
--really-i-mean-it --do-reset-the-fscking-working-directory-NOW", but I do 
not think that it makes sense.

If you want to reset the working directory, you want to reset the working 
directory.  If you wanted to save the changes somewhere, you should have 
done that.  We have enough ways to do that.


Apparently not.  So again, "reset --hard" means to reset HEAD, index and 
working directory to the revision you pass (defaulting to the HEAD).

The fact that you do not lose the information which used to be HEAD, is 
just a side-effect of Git storing all the revisions in one big graph.  It 
is _not_ implied by "reset", which, as I pointed out, means "re-set".


What would be a "nondestructive-discarding", /me wonders.


That is not "git reset --hard".

"move" to a new head is called "switching branches" in Git lingo (and BTW 
in many other SCM lingos, too, so you might just as well get used to it), 
and it is another command: "git checkout <branch>".

Incidentally, a friend just told me that "checkout" is everything but 
intuitive, and he would have preferred "git branch switch <branch>", but 
then settled for my proposed "git branch --switch <branch>", which I did 
not have time to implement yet, unfortunately.

Ciao,
Dscho

--
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:
Re: [PATCH] cmd_reset: don't trash uncommitted changes unl ..., Johannes Schindelin, (Wed Jun 25, 3:16 am)
Re: [PATCH] cmd_reset: don't trash uncommitted changes unl ..., Matthias Kestenholz, (Wed Jun 25, 3:24 am)
Re: [PATCH] cmd_reset: don't trash uncommitted changes unl ..., Johannes Schindelin, (Wed Jun 25, 5:33 am)
Re: [PATCH] cmd_reset: don't trash uncommitted changes unl ..., Johannes Schindelin, (Wed Jun 25, 5:38 am)
Re: [PATCH] cmd_reset: don't trash uncommitted changes unl ..., Johannes Schindelin, (Wed Jun 25, 6:59 pm)
Re: [PATCH] cmd_reset: don't trash uncommitted changes unl ..., Andreas Ericsson, (Wed Jun 25, 10:31 pm)
Re: [PATCH] cmd_reset: don't trash uncommitted changes unl ..., Johannes Schindelin, (Thu Jun 26, 5:07 am)
Re: [PATCH] cmd_reset: don't trash uncommitted changes unl ..., Johannes Schindelin, (Thu Jun 26, 5:09 am)
Re: [PATCH] cmd_reset: don't trash uncommitted changes unl ..., Johannes Schindelin, (Thu Jun 26, 10:49 am)