about summary refs log tree commit diff
path: root/Completion/Unix/Command/_git
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2007-10-19 02:17:54 +0000
committerClint Adams <clint@users.sourceforge.net>2007-10-19 02:17:54 +0000
commit1ef67287332288d3008d4e2554f1c1b42e27e63a (patch)
treefe3b37b8e909419f61b3b8a11b7d9dfb03edb1bc /Completion/Unix/Command/_git
parent29a869d5a8bc0efb5245310d2f12a418bbf64f19 (diff)
downloadzsh-1ef67287332288d3008d4e2554f1c1b42e27e63a.tar.gz
zsh-1ef67287332288d3008d4e2554f1c1b42e27e63a.tar.xz
zsh-1ef67287332288d3008d4e2554f1c1b42e27e63a.zip
Mikael Magnusson: 23993: improved completion for git show.
Diffstat (limited to 'Completion/Unix/Command/_git')
-rw-r--r--Completion/Unix/Command/_git16
1 files changed, 15 insertions, 1 deletions
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] )) ||