From: Benoit Sigoure Date: Mon, 17 Dec 2007 22:32:28 GMT Subject: Re: git-stash: RFC: Adopt the default behavior to other commands Message-ID: <506C6191-655D-46AE-A5C2-1335A9044F44@lrde.epita.fr> In-Reply-To: <20071217110322.GH14889@albany.tokkee.org> On Dec 17, 2007, at 12:03 PM, Sebastian Harl wrote: > Hi, > > By default, git-stash (when called without any other arguments) > creates a new > stash. This is quite different to the behavior of most other Git > commands > (e.g. git-tag, git-branch, etc. do "list" by default). In order to > improve > consistency git-stash should imho adopt this as well. > > The creation of a new stash should not do any harm. However, I > think that > consistency is more important (iirc this has been mentioned in the > current > survey a couple of times) and doing "list" is (in general) the best > default. Hi Sebastian, this topic has been brought up the ML several times already, and there seems to be some sort of consensus on the misbehavior of git stash and what the default should be (listing the stashes seems like a decent default action). The current behavior of git stash is very dangerous as the following frequently happens to new comers: $ git stash $ $ git commit $ git stash apply $ git stash clean # Oops, typo, I just stashed my changes again $ git stash clear # Oops, I just lost my changed Hopefully, Git gives you means to recover from this sort of error, but most of the time new comers don't know them and just assume they lost their work. Whenever I use git stash, it gives me chills, because I know I can easily screw things up (even though now I know how to recover from this sort of "user error"). Cheers, -- Benoit Sigoure aka Tsuna EPITA Research and Development Laboratory