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

PATCH: _git and revision_arguments



This seems a slightly cleaner.

Index: Completion/Unix/Command/_git
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
retrieving revision 1.34
diff -u -r1.34 _git
--- Completion/Unix/Command/_git	30 Sep 2007 18:43:08 -0000	1.34
+++ Completion/Unix/Command/_git	30 Sep 2007 19:17:07 -0000
@@ -15,6 +15,7 @@
 local help_arg template_arg shared_arg thin_arg author_conversion_file_arg_spec
 local -a diff_args fetch_args merge_args force_ref_arg tags_fetch_arg
 local -a upload_pack_arg common_fetch_args common_apply_args
+local -a revision_arguments
 
 nul_arg='-z[use NUL termination on output]'
 abbrev_arg='--abbrev=-[set minimum SHA1 display-length]: :_guard "[[\:digit\:]]#" length'
@@ -976,8 +977,6 @@
     _arguments \
       '*:index file:__git_cached_files' && ret=0
   else
-    declare -a revision_arguments
-
     __git_setup_revision_arguments
 
     _arguments -S \
@@ -1011,8 +1010,6 @@
 
 (( $+functions[_git-show] )) ||
 _git-show () {
-  declare -a revision_arguments
-
   __git_setup_revision_arguments
 
   _arguments -S \
@@ -1153,8 +1150,6 @@
 # TODO: -- undocumented.
 (( $+functions[_git-reflog] )) ||
 _git-reflog () {
-  declare -a revision_arguments
-
   __git_setup_revision_arguments
 
   if (( CURRENT == 2 )); then
@@ -1707,8 +1702,6 @@
 
 (( $+functions[_git-log] )) ||
 _git-log () {
-  declare -a revision_arguments
-
   __git_setup_revision_arguments
 
   _arguments -S \
@@ -1854,8 +1847,6 @@
 # less what git-rev-list takes).
 (( $+functions[_git-shortlog] )) ||
 _git-shortlog () {
-  declare -a revision_arguments
-
   __git_setup_revision_arguments
 
   _arguments -S \
@@ -1906,8 +1897,6 @@
 # TODO: This should take those arguments that git-diff-tree can take, as well.
 (( $+functions[_git-whatchanged] )) ||
 _git-whatchanged () {
-  declare -a revision_arguments
-
   __git_setup_revision_arguments
 
   _arguments -S \
@@ -2442,8 +2431,6 @@
             '--minimize[undocumented]')
           ;;
         (log)
-          declare -a revision_arguments
-
           __git_setup_revision_arguments
 
           arguments+=(



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