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

Re: Bug#428705: git reset HEAD completion not working



On Wed, Jun 13, 2007 at 05:15:23PM +0100, martin f krafft wrote:
> git reset HEAD Co<tab>
> 
> does not complete. It should probably get its data from the git
> status output:
> 
> # On branch master
> # Changes to be committed:
> #   (use "git reset HEAD <file>..." to unstage)
> #
> # new file:   src/ConfigBroker.py
> #
> 
> Alternatively, normal file completion would work, might even be better.

Probably __git_revisions should complete HEAD and HEAD^, though I don't
know what that is.

Index: Completion/Unix/Command/_git
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
retrieving revision 1.2
diff -u -r1.2 _git
--- Completion/Unix/Command/_git	25 Nov 2005 12:52:23 -0000	1.2
+++ Completion/Unix/Command/_git	13 Jun 2007 16:35:30 -0000
@@ -865,7 +865,8 @@
     '(        --soft --hard)--mixed[like --soft but report what has not been updated (default)]' \
     '(--mixed        --hard)--soft[do not touch the index file nor the working tree]' \
     '(--mixed --soft       )--hard[match the working tree and index to the given tree]' \
-    ':commit-ish:__git_revisions' && ret=0
+    ':commit-ish:__git_revisions' \
+    '*:path:_files' && ret=0
 }
 
 _git-resolve () {



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