Re: [PATCH] git-completion: fix zsh support

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

 



Felipe Contreras wrote:

> +++ b/contrib/completion/git-completion.bash
[...]
> @@ -739,12 +739,12 @@ __git_complete_revlist ()
>  
>  __git_complete_remote_or_refspec ()
>  {
> -	local cur words cword
> -	_get_comp_words_by_ref -n =: cur words cword
> -	local cmd="${words[1]}"
> +	local cur cwords cword
> +	_get_comp_words_by_ref -n =: cur cwords cword

Hmm, on second thought, this will break the following case, in bash:

	. /etc/bash_completion;	# defines _get_comp_words_by_ref
	. contrib/completion/git-completion.bash

Not sure how to salvage that.  Maybe we need a git-specific API
that wraps _get_comp_words_by_ref when the latter is available.

	if type _get_comp_words_by_ref >/dev/null 2>&1; then
		_git_get_comp_words_by_ref () {
			_get_comp_words_by_ref "$@"
			if test "${words+set}"
			then
				cword="${words[@]}"
			fi
		}
	else
		_git_get_comp_words_by_ref () {
			...
		}
	fi
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]