diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Unix/Command/_git | 16 |
2 files changed, 20 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 7fd634250..b42f6c144 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-19 Clint Adams <clint@zsh.org> + + * Mikael Magnusson: 23993: Completion/Unix/Command/_git: improved + completion for git show. + 2007-10-19 Geoff Wing <gcw@zsh.org> * 23924: Src/Zle/zle_main.c, Src/Zle/zle_refresh.c: Improve diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 5beee3c4f..86b767611 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1010,11 +1010,25 @@ _git-show-ref () { (( $+functions[_git-show] )) || _git-show () { + local curcontext=$curcontext state line __git_setup_revision_arguments _arguments -S \ $revision_arguments \ - '*:object:__git_revisions' && ret=0 + '*:object:->object' && ret=0 + + case $state in + (object) + compset -P '*:' + if [[ -n $IPREFIX ]]; then + __git_tree_files $IPREFIX[1,-2] + else + _alternative \ + 'revisions:revision:__git_revisions' \ + 'files:file:__git_files' + fi + ;; + esac } (( $+functions[_git-show-index] )) || |