Re: [PATCH for maint branch] git-completion: fix zsh support
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 5, 2011, 17:34 UTC
- Message-ID
- <7vtyd9830w.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1304605458-1483-1-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 20 quoted lines
> It turns out 'words' is a special variable used by zsh completion. > > There's probably a bug in zsh's bashcompinit: > http://article.gmane.org/gmane.comp.shells.zsh.devel/22546 > > But in the meantime we can workaround it this way. > > Currently zsh is completely broken after commit da48616 (bash: get > --pretty=m<tab> completion to work with bash v4), which introduced > _get_comp_words_by_ref() that comes from debian's bash_completion > scripts, and relies on the 'words' variable to behave like any normal > variable. > > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> > --- > contrib/completion/git-completion.bash | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > This patch is meant for the maintenance branch, so Szeder's patches are not > needed.
Do you mean sg/completion-upadates that is in 'next' need to be reverted and replaced with this one? If that is the case I would love to have an Acked-by in this patch.
Show 14 quoted lines
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 840ae38..8d5eae7 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -2710,6 +2710,9 @@ _git ()
> if [[ -n ${ZSH_VERSION-} ]]; then
> emulate -L bash
> setopt KSH_TYPESET
> +
> + # 'words' has special meaning in zsh; override that
> + typeset -h words
> fi
>
> local cur words cword