git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for maint branch] git-completion: fix zsh support
@ 2011-05-05 14:24 Felipe Contreras
  2011-05-05 17:34 ` Junio C Hamano
  2011-05-05 18:59 ` SZEDER Gábor
  0 siblings, 2 replies; 14+ messages in thread
From: Felipe Contreras @ 2011-05-05 14:24 UTC (permalink / raw)
  To: git; +Cc: SZEDER Gábor, Felipe Contreras

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.

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
-- 
1.7.5.1.1.g638e6

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-05-09 13:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-05 14:24 [PATCH for maint branch] git-completion: fix zsh support Felipe Contreras
2011-05-05 17:34 ` Junio C Hamano
2011-05-05 19:29   ` Felipe Contreras
2011-05-05 18:59 ` SZEDER Gábor
2011-05-05 19:52   ` [PATCH for maint] " Felipe Contreras
2011-05-05 23:25     ` Jonathan Nieder
2011-05-06  4:51       ` Junio C Hamano
2011-05-06  5:27         ` Jonathan Nieder
2011-05-06  9:34           ` Felipe Contreras
2011-05-06  9:27       ` Felipe Contreras
2011-05-06  9:59         ` Jonathan Nieder
2011-05-06 10:06           ` Jonathan Nieder
2011-05-09 13:51           ` Felipe Contreras
2011-05-06  1:28     ` Jonathan Nieder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).