threads / discuss / 14007

Incorrect default for git stash?

Subject: Incorrect default for git stash?

## tl;dr

8 messages between Jun 17, 2008 and Jun 23, 2008.

replies: 7people: 6as markdown or json

Eric Raible· Jun 17, 2008, 22:21 UTC · lore

Does it bother anyone else that the default for git stash is inconsistent with branch & tag?

git branch -> list branches git tag -> list tags git stash -> create a stash

I understand that branches & tags must explicitly named and that stashes are by default automatically named.

But wouldn't it be less surprising to me if the default was 'list' instead of 'save'?

- Eric
patrick.higgins@cexp.com· Jun 17, 2008, 22:29 UTC · re: Eric Raible · lore

RE: Incorrect default for git stash?

Eric Raible wrote:
> git branch -> list branches
> git tag    -> list tags
> git stash  -> create a stash

git commit -> list commits? git checkout -> list checkouts? git prune -> list prunes? git pull -> list pullables?

Why would you expect stash to behave like branch and tag?
David Kågedal· Jun 23, 2008, 17:14 UTC · re: patrick.higgins@cexp.com · lore

Re: Incorrect default for git stash?

<Patrick.Higgins@cexp.com> writes:
Show 12 quoted lines
> Eric Raible wrote:
>
>> git branch -> list branches
>> git tag    -> list tags
>> git stash  -> create a stash
>
> git commit -> list commits?
> git checkout -> list checkouts?
> git prune -> list prunes?
> git pull -> list pullables?
>
> Why would you expect stash to behave like branch and tag?
Because is kindof does.
I would prefer to have two simple commands
  git stash
  git unstash

and not bother with named stashes etc (for that I use stgit or normal branches). You'd need a way to clear the stash as well.

-- 
David Kågedal
Junio C Hamano· Jun 17, 2008, 22:32 UTC · re: Eric Raible · lore

Re: Incorrect default for git stash?

Eric Raible <raible@gmail.com> writes:
Show 14 quoted lines
> Does it bother anyone else that the default for
> git stash is inconsistent with branch & tag?
>
> git branch -> list branches
> git tag    -> list tags
> git stash  -> create a stash
>
> I understand that branches & tags must explicitly named
> and that stashes are by default automatically named.
>
> But wouldn't it be less surprising to me if the default
> was 'list' instead of 'save'?
>
> - Eric
Read the whole thread:
http://thread.gmane.org/gmane.comp.version-control.git/63566/focus=63784
Eric Raible· Jun 17, 2008, 22:44 UTC · re: Junio C Hamano · lore

Re: Incorrect default for git stash?

Junio C Hamano <gitster <at> pobox.com> writes:
 
> Read the whole thread:
> 
> http://thread.gmane.org/gmane.comp.version-control.git/63566/focus=63784

I'm glad to know that that was already hashed out, even if it didn't end up the way I would have decided.

Thanks for the pointer.
しらいしななこ· Jun 17, 2008, 23:12 UTC · re: Eric Raible · lore

Re: Incorrect default for git stash?

Quoting Eric Raible <raible@gmail.com>:
Show 8 quoted lines
> Junio C Hamano <gitster <at> pobox.com> writes:
>  
>> Read the whole thread:
>> 
>> http://thread.gmane.org/gmane.comp.version-control.git/63566/focus=63784
>
> I'm glad to know that that was already hashed out, even if it
> didn't end up the way I would have decided.

Then I suspect you did not read the whole thread, as we have not "ended up" in anywhere yet.

In particular, in
  http://thread.gmane.org/gmane.comp.version-control.git/63566/focus=63781

Junio maps out the next steps for people, who would want the behavior of the command changed, to take. None of these follow-up steps have been taken by people who wanted to change the behavior of the command.

I can well imagine an alternative to make the command "list" by default when stash.defaultsave is set to false, and actually suggested it earlier with a patch, but I think the list consensus was negative.

  http://thread.gmane.org/gmane.comp.version-control.git/68539/focus=69045
-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

----------------------------------------------------------------------
Get a free email address with REAL anti-spam protection.
http://www.bluebottle.com/tag/1
Eric Raible· Jun 18, 2008, 00:37 UTC · re: しらいしななこ · lore

Re: Incorrect default for git stash?

しらいしななこ <nanako3 <at> bluebottle.com> writes:
> Then I suspect you did not read the whole thread, as we have not "ended up"
> in anywhere yet.
You're right, of course.

I was hasty in my gmail, and was referring to http://article.gmane.org/gmane.comp.version-control.git/85337 when I made that comment.

Anyway, I don't care enough either, especially since Junio claims to be "quietly rewriting git-stash in C".

- Eric
Jeff King· Jun 17, 2008, 22:32 UTC · re: Eric Raible · lore

Re: Incorrect default for git stash?

On Tue, Jun 17, 2008 at 10:21:23PM +0000, Eric Raible wrote:
Show 12 quoted lines
> Does it bother anyone else that the default for
> git stash is inconsistent with branch & tag?
> 
> git branch -> list branches
> git tag    -> list tags
> git stash  -> create a stash
> 
> I understand that branches & tags must explicitly named
> and that stashes are by default automatically named.
> 
> But wouldn't it be less surprising to me if the default
> was 'list' instead of 'save'?

I don't know if it still bothers people, but this was discussed when stash was first merged:

  http://kerneltrap.org/mailarchive/git/2007/7/1/250414
-Peff

← back to recent threads