Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: A stab at better git-show completion



On Fri, Oct 19, 2007 at 03:44:43AM +0200, Mikael Magnusson wrote:
> I decided i want to get very confused, so i decided to try and make
> git-show completion allow
> completing of the form commit:path/file where the path/file part
> depends on what commit you
> typed. Somehow i succeeded. (the [1,-2] is for removing the trailing colon)

Committing with the following modifications:

Index: Completion/Unix/Command/_git
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
retrieving revision 1.48
diff -u -r1.48 _git
--- Completion/Unix/Command/_git	19 Oct 2007 02:18:00 -0000	1.48
+++ Completion/Unix/Command/_git	19 Oct 2007 02:23:42 -0000
@@ -1011,6 +1011,7 @@
 (( $+functions[_git-show] )) ||
 _git-show () {
   local curcontext=$curcontext state line
+  typeset -A opt_args
   __git_setup_revision_arguments
 
   _arguments -S \
@@ -1021,7 +1022,7 @@
     (object)
       compset -P '*:'
       if [[ -n $IPREFIX ]]; then
-        __git_tree_files $IPREFIX[1,-2]
+        __git_tree_files ${IPREFIX%:}
       else
         _alternative \
           'revisions:revision:__git_revisions' \



Messages sorted by: Reverse Date, Date, Thread, Author