Skip to contentSkip to conversation

Incorrect default for git stash?

DISCUSSION Eric Raible 6 participants 8 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 7 lines · Eric Raible

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

Quoted 5 lines

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

#2 lore raw
In reply to Eric Raible
Quoted 7 lines · Eric Raible

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

Quoted 7 lines

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

#4 lore raw

Quoting Eric Raible <[email protected]>:

Quoted 8 lines
Quoted 3 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

Signature · 6 lines
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

----------------------------------------------------------------------
Get a free email address with REAL anti-spam protection.
http://www.bluebottle.com/tag/1
#5 lore raw
Quoted 2 lines · しらいしななこ <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

#6 lore raw
In reply to Eric Raible
Quoted 3 lines · Eric Raible

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?

#7 lore raw
Quoted 6 lines · <[email protected]> writes:
Quoted 3 lines · Eric Raible

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

Quoted 6 lines

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.

Signature · 1 line
David Kågedal