From: Jonathan Nieder Date: Wed, 27 Apr 2011 02:21:17 GMT Subject: Re: [PATCH] git-completion: fix zsh support Message-ID: <20110427022117.GA16697@elie> In-Reply-To: <1303867612-15975-1-git-send-email-felipe.contreras@gmail.com> 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