Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] git-stash: Display help message if git-stash is run with wrong sub-commands

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:55

Possibly related (same subject, not in this thread)

"Kevin Leung" [off-list ref] writes:
The current git-stash behaviour is very error prone to typos. For example,
if you typed "git-stash llist", git-stash would think that you wanted to
save to a stash named "llist", but in fact, you meant "git-stash list".

Signed-off-by: Kevin Leung <redacted>
Thanks.  Looks good.  except...
quoted hunk
@@ -195,6 +195,10 @@ show)
        shift
        show_stash "$@"
        ;;
+save)
+       shift
+       save_stash "$@" && git-reset --hard
+       ;;
... this should be "$*" as it was originally spelled.

Save this script in foo.sh and run "foo.sh a b c" to see what I mean.

#!/bin/sh

foo () {
	msg="$1"
	echo "Foo here <$1>"
}

foo "$@"
foo "$*"
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help