RE: [PATCH v2] contrib/completion: fix zsh completion regression from 59d85a2a05

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Aguilar wrote:
> --- a/contrib/completion/git-completion.zsh
> +++ b/contrib/completion/git-completion.zsh
> @@ -251,7 +251,7 @@ __git_zsh_main ()
>  		done
>  		;;
>  	(arg)
> -		local command="${words[1]}" __git_dir
> +		local command="${words[1]}" __git_dir __git_cmd_idx=1
>  
>  		if (( $+opt_args[--bare] )); then
>  			__git_dir='.'

Note that this is not the correct fix, since the index of the command
will not always be 1.

We would probably need to at least do something like:

--- a/git-completion.zsh
+++ b/git-completion.zsh
@@ -260,7 +260,7 @@ __git_zsh_main ()
 
                (( $+opt_args[--help] )) && command='help'
 
-               words=( ${orig_words[@]} )
+               words=( git ${words[@]} )
 
                __git_zsh_bash_func $command
                ;;

And then it will almost always do the correct thing (at least in
git-completion[1] which does have all the git main arguments).

For now doing __git_cmd_idx=1 should fix the regression.

Cheers.

[1] https://github.com/felipec/git-completion

-- 
Felipe Contreras



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux