summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6e9e032)
raw | patch | inline | side by side (parent: 6e9e032)
author | Kevin Leung <kevinlsk@gmail.com> | |
Mon, 3 Dec 2007 02:34:05 +0000 (10:34 +0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Dec 2007 02:51:09 +0000 (18:51 -0800) |
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 <kevinlsk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 <kevinlsk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-stash.sh | patch | blob | history |
diff --git a/git-stash.sh b/git-stash.sh
index b1529e28b1c4eb8b236bd497c83690c20621d369..f16fd9c3c0e5b9248623d1d65146504c603fc840 100755 (executable)
--- a/git-stash.sh
+++ b/git-stash.sh
#!/bin/sh
# Copyright (c) 2007, Nanako Shiraishi
-USAGE='[ | list | show | apply | clear]'
+USAGE='[ | save | list | show | apply | clear | create ]'
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=
shift
show_stash "$@"
;;
+save)
+ shift
+ save_stash "$*" && git-reset --hard
+ ;;
apply)
shift
apply_stash "$@"
fi
create_stash "$*" && echo "$w_commit"
;;
-help | usage)
- usage
- ;;
*)
- if test $# -gt 0 && test "$1" = save
+ if test $# -eq 0
then
- shift
+ save_stash && git-reset --hard
+ else
+ usage
fi
- save_stash "$*" && git-reset --hard
;;
esac