summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a6c2be2)
raw | patch | inline | side by side (parent: a6c2be2)
author | Lee Marlow <lee.marlow@gmail.com> | |
Tue, 5 Aug 2008 05:50:35 +0000 (23:50 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 Aug 2008 04:21:19 +0000 (21:21 -0700) |
Add branch subcommand to completions and USAGE for git-stash.sh.
Complete stash names for show, apply, drop, pop, and branch.
Add "--index" long option for apply.
Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Complete stash names for show, apply, drop, pop, and branch.
Add "--index" long option for apply.
Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash | patch | blob | history | |
git-stash.sh | patch | blob | history |
index 265842712e3826b78758e92b98edb0ee89119d30..49a03c314e9159c11a31c065f50ceef4acdcd873 100755 (executable)
_git_stash ()
{
- local subcommands='save list show apply clear drop pop create'
+ local subcommands='save list show apply clear drop pop create branch'
local subcommand="$(__git_find_subcommand "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
save,--*)
__gitcomp "--keep-index"
;;
+ apply,--*)
+ __gitcomp "--index"
+ ;;
+ show,--*|apply,--*|drop,--*|pop,--*|branch,--*)
+ COMPREPLY=()
+ ;;
+ show,*|apply,*|drop,*|pop,*|branch,*)
+ __gitcomp "$(git --git-dir="$(__gitdir)" stash list \
+ | sed -n -e 's/:.*//p')"
+ ;;
*)
COMPREPLY=()
;;
diff --git a/git-stash.sh b/git-stash.sh
index d4609ed66e56dc6021c800d60286bec38615ff39..5ad2c4b7a33cf1be24ee85f17c8738ca05b98db0 100755 (executable)
--- a/git-stash.sh
+++ b/git-stash.sh
#!/bin/sh
# Copyright (c) 2007, Nanako Shiraishi
-USAGE='[ | save | list | show | apply | clear | drop | pop | create ]'
+USAGE='[ | save | list | show | apply | clear | drop | pop | create | branch ]'
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=