git-stash: RFC: Adopt the default behavior to other commands

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

git-stash: RFC: Adopt the default behavior to other commands

From: Sebastian Harl <hidden>
Date: 2016-06-15 22:43:59

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.

Comments?

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

Re: git-stash: RFC: Adopt the default behavior to other commands

From: Benoit Sigoure <hidden>
Date: 2016-06-15 22:44:00

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
   $ <hack on something else>
   $ 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help