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

[PATCH 3/5] completion: remove zsh hack

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jun 14, 2019, 06:50 UTC
Message-ID
<20190614065051.17774-4-felipe.contreras@gmail.com>
In-Reply-To
<20190614065051.17774-1-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 9f71bcde96..57cced3f51 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -3066,6 +3066,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 067738d93f..58b3b5c27d 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -18,12 +18,6 @@
 #  zstyle ':completion:*:*:git:*' script ~/.git-completion.bash
 #
 
-complete ()
-{
-	# do nothing
-	return 0
-}
-
 zstyle -T ':completion:*:*:git:*' tag-order && \
 	zstyle ':completion:*:*:git:*' tag-order 'common-commands'
 
-- 
2.22.0.rc2.dirty
Previous: Felipe ContrerasNext: Felipe Contreras
Message 4 of 6 in “contrib: completion: general zsh updates”
  1. 0/5 contrib: completion: general zsh updatesFelipe Contreras, Jun 14, 2019
  2. 1/5 completion: zsh: update installation instructionsFelipe Contreras, Jun 14, 2019
  3. 2/5 completion: zsh: fix for directories with spacesFelipe Contreras, Jun 14, 2019
  4. 3/5 completion: remove zsh hackFelipe Contreras, Jun 14, 2019
  5. 4/5 completion: zsh: improve main function selectionFelipe Contreras, Jun 14, 2019
  6. 5/5 completion: prompt: fix color for ZshFelipe Contreras, Jun 14, 2019

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.