git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/6] completion: remove zsh hack

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 30, 2014, 11:07 UTC
Message-ID
<1398856065-2982-5-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1398856065-2982-1-git-send-email-felipe.contreras@gmail.com>

We don't want to override the 'complete()' function in zsh, which can be used by bashcomp.

Reported-by: Mark Lodato <lodato@google.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/completion/git-completion.bash | 1 +
 contrib/completion/git-completion.zsh  | 6 ------
 2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index be0ea36..f1ce962 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2586,6 +2586,7 @@ __git_func_wrap ()
 # This is NOT a public function; use at your own risk.
 __git_complete ()
 {
+	test -n "$ZSH_VERSION" && return
 	local wrapper="__git_wrap${2}"
 	eval "$wrapper () { __git_func_wrap $2 ; }"
 	complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \
diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
index 6432b3f..e71896a 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -16,12 +16,6 @@
 #
 #  fpath=(~/.zsh $fpath)
 
-complete ()
-{
-	# do nothing
-	return 0
-}
-
 zstyle -T ':completion:*:*:git:*' tag-order && \
 	zstyle ':completion:*:*:git:*' tag-order 'common-commands'
 
-- 
1.9.2+fc1.11.g71fb719
Previous: Felipe ContrerasNext: Felipe Contreras
Message 5 of 7 in “completion: fixes”
  1. 0/6 completion: fixesFelipe Contreras, Apr 30, 2014
  2. 1/6 completion: bash: remove old wrappersFelipe Contreras, Apr 30, 2014
  3. 2/6 completion: bash: remove zsh wrapperFelipe Contreras, Apr 30, 2014
  4. 3/6 completion: zsh: don't hide ourselvesFelipe Contreras, Apr 30, 2014
  5. 4/6 completion: remove zsh hackFelipe Contreras, Apr 30, 2014
  6. 5/6 completion: zsh: trivial cleanupsFelipe Contreras, Apr 30, 2014
  7. 6/6 completion: bash: cleanup cygwin checkFelipe Contreras, Apr 30, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.