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

From: Andreas Ericsson <[email-masked]>
Date: Tue, 18 Dec 2007 16:00:10 +0100

Johannes Schindelin wrote:
> Hi,
> 
> On Tue, 18 Dec 2007, Andreas Ericsson wrote:
> 
>> Johannes Schindelin wrote:
>>
>>> On Tue, 18 Dec 2007, Sebastian Harl wrote:
>>>
>>>> On Mon, Dec 17, 2007 at 04:31:12PM -0800, Junio C Hamano wrote:
>>>>> But the original point by Sebastian hasn't been answered.  He 
>>>>> wanted to make the command list the stash without arguments.
>>>>>
>>>>> This was discussed already in the early days of stash and there 
>>>>> indeed was a suggestion to do so (I think I sided with that), but 
>>>>> the users did not want it.  IIRC, the argument went like: "when I 
>>>>> say 'stash', that is because I want a quick and immediate way to 
>>>>> stash, and I do not want a list.  If I do not have to have a quick 
>>>>> way, I would create a temporary commit on the current branch, or 
>>>>> switch to a temporary branch and commit there."
>>>> Well, "git stash save" is just five characters more - I really don't 
>>>> see why this would be less comfortable (and for the really lazy 
>>>> people there are still aliases...). On the other hand (if "list" is 
>>>> the default), we'd get a more consistent interface which imho is 
>>>> imho more important than typing five characters less.
>>> It's more about what you're used to.  I had an alias named 'stash' 
>>> long before it became a git command.  And now guess how _annoying_ it 
>>> would be to type "git stash<Return><Curse out loud at my mouse>git 
>>> stash save<Return>".
>> Not nearly as annoying as losing work because of it, and you obviously 
>> *know* what to do when you're done cursing, while clueless-newbie-X just 
>> hops away and uses subversion.
> 
> Really?  Clueless-newbie-X certainly knows how to apply the stash, 
> otherwise she would not have used the command, right?
> 

Far too many times I've seen people expect help output if the command
they're running is even remotely dangerous, so they go ahead and run
it without arguments to see what it does.

> In the alternative, you could just scrap all those default actions, 
> showing synopses instead.  For all commands, including "git commit", "git 
> log", "git fetch", etc.
> 

Like we do for the git wrapper, you mean? Yes, that would be one solution,
although not a very good one for all commands.

It's probably not a bad idea for commands where the primary use is
something else than producing visual output though, such as tag or branch,
but those handle creation/deletion of stuff, so the default action for them
is to list stuff of the kind they operate on. I fail to see why stash should
be any different.

> See?

Not really, no. What was your point?

-- 
Andreas Ericsson                   [email-masked]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231