Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: partly rewriting alias handling in _git
- X-seq: zsh-workers 25585
- From: Clint Adams <clint@xxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: PATCH: partly rewriting alias handling in _git
- Date: Mon, 1 Sep 2008 19:22:26 +0000
- In-reply-to: <20080901180642.GE6330@xxxxxxxxxxxxxxx>
- Mail-followup-to: zsh workers <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080901180642.GE6330@xxxxxxxxxxxxxxx>
On Mon, Sep 01, 2008 at 08:06:42PM +0200, Frank Terbeck wrote:
> % git c --some args
> ^- place the cursor here and hit <tab>.
>
> That does not return completions like 'commit'.
Try this.
Index: Completion/Unix/Command/_git
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
retrieving revision 1.96
diff -u -r1.96 _git
--- Completion/Unix/Command/_git 1 Sep 2008 18:49:33 -0000 1.96
+++ Completion/Unix/Command/_git 1 Sep 2008 19:19:59 -0000
@@ -4307,15 +4307,15 @@
'(-p --paginate)'{-p,--paginate}'[pipe output into $PAGER]' \
'--git-dir=-[path to repository]:directory:_directories' \
'--bare[use $PWD as repository]' \
- ':command:->command' \
- '*::options:->options' && ret=0
+ '*::arg:->cmd_or_options' && return
case $state in
- (command)
- __git_aliases_and_commands
- ;;
- (options)
- curcontext="${curcontext%:*:*}:git-$words[1]:"
- _call_function ret _git-$words[1]
+ (cmd_or_options)
+ if (( CURRENT == 1 )); then
+ __git_aliases_and_commands
+ else
+ curcontext="${curcontext%:*:*}:git-$words[1]:"
+ _call_function ret _git-$words[1]
+ fi
;;
esac
else
Messages sorted by:
Reverse Date,
Date,
Thread,
Author