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

[PATCH] completion: fix warning for zsh

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 29, 2012, 08:20 UTC
Message-ID
<1354177257-5416-1-git-send-email-felipe.contreras@gmail.com>
Otherwise the user might get something like:
  git-completion.sh:2466: command not found: compdef

If this script is loaded before compinit. The script would work either way, but let's not be more annoying to the user.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/completion/git-completion.bash | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index af13fcc..0b77eb1 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2404,6 +2404,8 @@ __gitk_main ()
 if [[ -n ${ZSH_VERSION-} ]]; then
 	echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2
 
+	autoload -U +X compinit && compinit
+
 	__gitcomp ()
 	{
 		emulate -L zsh
-- 
1.8.0.1
Next: Junio C Hamano
Message 1 of 2 in “completion: fix warning for zsh”
  1. completion: fix warning for zshFelipe Contreras, Nov 29, 2012
  2. Junio C HamanoNov 29, 2012

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.