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

Re: more _git improvements?



On Sat, Dec 01, 2007 at 11:48:03PM -0800, Wayne Davison wrote:
> I was looking at the git alias support in the current _git completion,
> and it appears to only be used to list alias words when completing a
> subcommand, but has no effect when completing options after an alias.
> For instance, I have a git for b=branch in my .gitconfig file, and if I
> press TAB after "git b" it is listed as an alias.  However if I type an
> extra space and a dash before pressing TAB ("git b -"), I don't get any
> completions.  Can the completion system substitute the alias text and
> show me the completions for "git branch -" (presumably without actually
> changing the "b" into "branch" on the command-line)?

We need some layer of indirection down at the bottom where $words[1] is
being used.  I think it's a smidge more complicated than just doing a
simple replacement since aliases may expand to multiple words.

> One other thing I noticed is that the "config" subcommand appears twice:
> once in useful_commands, and once in ancillary_commands.  This results
> in some completing confusion when completing "conf".  I chose to just
> dump one of them (I dumped the "useful" one), and that makes it work
> better in my limited testing (but I'm not sure it's right).
> 
> Finally, if someone checks in some changes, there is a "thee" that
> should be "the" in the "gc" command:
> 
>     'gc:cleanup unnecessary files and optimize thee local repository'
> 
> I could check-in a fix for that, but I figure it can wait for a more
> substantial change (if one is coming).

I'd rather not wait to fix things, what with 4.3.5 being imminent and
all.

Index: Completion/Unix/Command/_git
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
retrieving revision 1.52
diff -u -r1.52 _git
--- Completion/Unix/Command/_git	22 Nov 2007 19:09:28 -0000	1.52
+++ Completion/Unix/Command/_git	3 Dec 2007 02:03:48 -0000
@@ -150,7 +150,7 @@
     'commit:record changes to the repository'
     'diff:show changes between commits, commit and working tree, etc.'
     'fetch:download objects and a head from another repository'
-    'gc:cleanup unnecessary files and optimize thee local repository'
+    'gc:cleanup unnecessary files and optimize the local repository'
     'grep:print lines matching a pattern'
     'init:create empty git object database'
     'log:show commit logs'
@@ -238,7 +238,6 @@
   useful_commands=(
     'format-patch:prepare patches for e-mail submission'
     'ls-files:information about files in the index/working directory'
-    'config:get and set options in "$GIT_DIR/config"'
     'instaweb:instantly browse your working repository in gitweb'
     'remote:manage set of tracked repositories'
     'send-email:send patch-e-mails out of "format-patch" output'



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