Merge branch 'pw/completion-stash'
authorJunio C Hamano <gitster@pobox.com>
Wed, 3 Feb 2016 22:16:06 +0000 (14:16 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Feb 2016 22:16:06 +0000 (14:16 -0800)
* pw/completion-stash:
completion: update completion arguments for stash

1  2 
contrib/completion/git-completion.bash
index 8e783eacf1b9d0b17d9f6350ff722d28548af23c,07fa13b5672ee8ae60d40374cffcb6ec90ae36a2..15ebba51dc11ec28f98f6c759719125f155aa5d3
@@@ -1169,7 -1169,7 +1169,7 @@@ __git_diff_common_options="--stat --num
                        --no-prefix --src-prefix= --dst-prefix=
                        --inter-hunk-context=
                        --patience --histogram --minimal
 -                      --raw --word-diff
 +                      --raw --word-diff --word-diff-regex=
                        --dirstat --dirstat= --dirstat-by-file
                        --dirstat-by-file= --cumulative
                        --diff-algorithm=
@@@ -1312,7 -1312,6 +1312,7 @@@ _git_grep (
                        --full-name --line-number
                        --extended-regexp --basic-regexp --fixed-strings
                        --perl-regexp
 +                      --threads
                        --files-with-matches --name-only
                        --files-without-match
                        --max-depth
@@@ -1688,12 -1687,8 +1688,12 @@@ _git_rebase (
                        --preserve-merges --stat --no-stat
                        --committer-date-is-author-date --ignore-date
                        --ignore-whitespace --whitespace=
 -                      --autosquash --fork-point --no-fork-point
 -                      --autostash
 +                      --autosquash --no-autosquash
 +                      --fork-point --no-fork-point
 +                      --autostash --no-autostash
 +                      --verify --no-verify
 +                      --keep-empty --root --force-rebase --no-ff
 +                      --exec
                        "
  
                return
@@@ -1813,7 -1808,7 +1813,7 @@@ _git_config (
                return
                ;;
        branch.*.rebase)
 -              __gitcomp "false true"
 +              __gitcomp "false true preserve interactive"
                return
                ;;
        remote.pushdefault)
@@@ -2373,7 -2368,7 +2373,7 @@@ _git_show_branch (
        case "$cur" in
        --*)
                __gitcomp "
 -                      --all --remotes --topo-order --current --more=
 +                      --all --remotes --topo-order --date-order --current --more=
                        --list --independent --merge-base --no-name
                        --color --no-color
                        --sha1-name --sparse --topics --reflog
  
  _git_stash ()
  {
-       local save_opts='--keep-index --no-keep-index --quiet --patch'
+       local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
        local subcommands='save list show apply clear drop pop create branch'
        local subcommand="$(__git_find_on_cmdline "$subcommands")"
        if [ -z "$subcommand" ]; then
                apply,--*|pop,--*)
                        __gitcomp "--index --quiet"
                        ;;
-               show,--*|drop,--*|branch,--*)
+               drop,--*)
+                       __gitcomp "--quiet"
                        ;;
-               show,*|apply,*|drop,*|pop,*|branch,*)
+               show,--*|branch,--*)
+                       ;;
+               branch,*)
+                 if [ $cword -eq 3 ]; then
+                       __gitcomp_nl "$(__git_refs)";
+                       else
+                               __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
+                                               | sed -n -e 's/:.*//p')"
+                       fi
+                       ;;
+               show,*|apply,*|drop,*|pop,*)
                        __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
                                        | sed -n -e 's/:.*//p')"
                        ;;