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

Re: PATCH: _git log arguments



On 9/30/07, Clint Adams <clint@xxxxxxx> wrote:
> I tried this with various things that called git-ls-files but
> they were insanely slow.

> -    $revision_arguments && ret=0
> +    "$revision_arguments[@]" \

Why use "$revision_arguments[@]"?  $revision_arguments works just as
good and you don't need all the quoting and expansion fluff.  I see
this style has been used for $merge_args as well, even though most of
the file doesn't.

> +    '*:tree-ish: _alternative c\:\:__git_committishs f\:\:_files' && ret=0

I don't like this at all.  Why not simply use __git_cached_files?  And
if we really need __git_committishs, let's at least use a separate
function for that with proper descriptions and tags.

Index: Completion/Unix/Command/_git
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
retrieving revision 1.33
diff -u -r1.33 _git
--- Completion/Unix/Command/_git        30 Sep 2007 18:18:18 -0000      1.33
+++ Completion/Unix/Command/_git        1 Oct 2007 07:15:31 -0000
@@ -1711,7 +1711,8 @@
   __git_setup_revision_arguments

   _arguments -S \
-    $revision_arguments && ret=0
+    $revision_arguments \
+    '*:file:__git_cached_files' && ret=0
 }

 # TODO: repository needs fixing

  nikolai



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