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

[PATCH v2 12/29] completion: fix conflict with bashcomp

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Oct 25, 2020, 03:13 UTC
Message-ID
<20201025031343.346913-13-felipe.contreras@gmail.com>
In-Reply-To
<20201025031343.346913-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 26d6ee20b0..6de0e7b482 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -3475,6 +3475,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 c2a90beb8b..1de9b9c80d 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -21,12 +21,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.29.0
Previous: Felipe ContrerasNext: Felipe Contreras
Message 11 of 32 in “completion: zsh: latest patches”
  1. 00/29 completion: zsh: latest patchesFelipe Contreras, Oct 25, 2020
  2. 02/29 completion: zsh: fix name due to broken autoloadingFelipe Contreras, Oct 25, 2020
  3. 01/29 completion: zsh: fix __gitcomp_direct()Felipe Contreras, Oct 25, 2020
  4. 04/29 completion: zsh: reorganize install instructionsFelipe Contreras, Oct 25, 2020
  5. 05/29 completion: zsh: fix for directories with spacesFelipe Contreras, Oct 25, 2020
  6. 06/29 completion: zsh: update slave script locationsFelipe Contreras, Oct 25, 2020
  7. 07/29 completion: prompt: fix color for ZshFelipe Contreras, Oct 25, 2020
  8. 08/29 completion: zsh: fix for command aliasingFelipe Contreras, Oct 25, 2020
  9. 10/29 completion: bash: remove zsh wrapperFelipe Contreras, Oct 25, 2020
  10. 03/29 completion: zsh: fix bash script extensionFelipe Contreras, Oct 25, 2020
  11. 12/29 completion: fix conflict with bashcompFelipe Contreras, Oct 25, 2020
  12. 13/29 completion: zsh: add missing direct_appendFelipe Contreras, Oct 25, 2020
  13. 16/29 completion: zsh: simplify direct compaddFelipe Contreras, Oct 25, 2020
  14. 15/29 completion: zsh: simplify compadd functionsFelipe Contreras, Oct 25, 2020
  15. 17/29 completion: zsh: trivial cleanupFelipe Contreras, Oct 25, 2020
  16. 14/29 completion: zsh: fix splitting of wordsFelipe Contreras, Oct 25, 2020
  17. 18/29 completion: zsh: simplify nl_appendFelipe Contreras, Oct 25, 2020
  18. 19/29 completion: zsh: simplify file_directFelipe Contreras, Oct 25, 2020
  19. 09/29 completion: bash: synchronize zsh wrapperFelipe Contreras, Oct 25, 2020
  20. 20/29 completion: zsh: shuffle functions aroundFelipe Contreras, Oct 25, 2020
  21. 24/29 completion: zsh: trivial simplificationFelipe Contreras, Oct 25, 2020
  22. 22/29 completion: zsh: improve command tagsFelipe Contreras, Oct 25, 2020
  23. 11/29 completion: zsh: fix completion for --no-.. optionsFelipe Contreras, Oct 25, 2020
  24. 21/29 completion: zsh: refactor command completionFelipe Contreras, Oct 25, 2020
  25. 25/29 completion: zsh: add simple version checkFelipe Contreras, Oct 25, 2020
  26. 23/29 completion: zsh: add alias descriptionsFelipe Contreras, Oct 25, 2020
  27. 27/29 completion: bash: cleanup cygwin checkFelipe Contreras, Oct 25, 2020
  28. 28/29 completion: bash: remove old compat wrappersFelipe Contreras, Oct 25, 2020
  29. 26/29 completion: bash: trivial cleanupFelipe Contreras, Oct 25, 2020
  30. 29/29 Update copyright noticesFelipe Contreras, Oct 25, 2020
  31. Junio C HamanoOct 27, 2020
  32. Felipe ContrerasOct 28, 2020

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.