Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: A stab at better git-show completion
- X-seq: zsh-workers 23994
- From: Clint Adams <clint@xxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Subject: Re: A stab at better git-show completion
- Date: Thu, 18 Oct 2007 22:24:20 -0400
- Cc: zsh-workers <zsh-workers@xxxxxxxxxx>
- In-reply-to: <237967ef0710181844o71d08aa0tc2f8158f504e6ed7@xxxxxxxxxxxxxx>
- Mail-followup-to: Mikael Magnusson <mikachu@xxxxxxxxx>, zsh-workers <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <237967ef0710181844o71d08aa0tc2f8158f504e6ed7@xxxxxxxxxxxxxx>
On Fri, Oct 19, 2007 at 03:44:43AM +0200, Mikael Magnusson wrote:
> I decided i want to get very confused, so i decided to try and make
> git-show completion allow
> completing of the form commit:path/file where the path/file part
> depends on what commit you
> typed. Somehow i succeeded. (the [1,-2] is for removing the trailing colon)
Committing with the following modifications:
Index: Completion/Unix/Command/_git
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_git,v
retrieving revision 1.48
diff -u -r1.48 _git
--- Completion/Unix/Command/_git 19 Oct 2007 02:18:00 -0000 1.48
+++ Completion/Unix/Command/_git 19 Oct 2007 02:23:42 -0000
@@ -1011,6 +1011,7 @@
(( $+functions[_git-show] )) ||
_git-show () {
local curcontext=$curcontext state line
+ typeset -A opt_args
__git_setup_revision_arguments
_arguments -S \
@@ -1021,7 +1022,7 @@
(object)
compset -P '*:'
if [[ -n $IPREFIX ]]; then
- __git_tree_files $IPREFIX[1,-2]
+ __git_tree_files ${IPREFIX%:}
else
_alternative \
'revisions:revision:__git_revisions' \
Messages sorted by:
Reverse Date,
Date,
Thread,
Author