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

Re: Fix a typo in _git.



On Sat, Aug 16, 2008 at 01:56:36AM +0200, Mikael Magnusson wrote:
> http://git.mika.l3ib.org/?p=zsh-cvs.git;a=history;f=Completion/Unix/Command/_git;h=mika


From: Mikael Magnusson <mikachu@xxxxxxxxx>
Date: Tue, 19 Aug 2008 01:10:13 +0000 (+0200)
Subject: Complete revs and files after `git bisect start`.
X-Git-Url: http://git.mika.l3ib.org:1234/?p=zsh-cvs.git;a=commitdiff_plain;h=f2886ca3b3180c9327784b90ab3fcb56c554a8a5

Complete revs and files after `git bisect start`.

I'm using _files here since the bisection works across a range of commits
that might have different paths in them anyway, and I think gathering
all paths across the whole range is just masochistic and very slow,
so might as well use the ones from the working dir.

The -- is optional so technically the second _arguments could have an
_alternative that also adds _files, but I think that would just make
the completion messier for little value.
---

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 0e2efab..468ce14 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -1464,6 +1464,16 @@ _git-bisect () {
         _arguments \
           '*::arguments: _normal' && ret=0
         ;;
+      (start)
+        if (( words[(I)--] < CURRENT && words[(I)--] > 0 )); then
+          _arguments \
+            '*:paths:_files' && ret=0
+        else
+          _arguments \
+            '2:bad revision:__git_commits' \
+            '*:good revision:__git_commits' && ret=0
+        fi
+        ;;
 
       (*)
         _nothing



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