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

[PATCH] Use ZSH_NAME instead of ZSH_VERSION because it's redefined by git-completion.zsh

From
Rick van Hattem <wolph@wol.ph>
Date
Jun 3, 2018, 16:38 UTC
Message-ID
<01020163c683e753-04629405-15f8-4a30-9dc3-e4e3f2a5aa26-000000@eu-west-1.amazonses.com>
The `git-completion.zsh` unsets the `$ZSH_VERSION` which makes this check moot. The result (at least for me) is that zsh segfaults because of all the variables it's unsetting.
---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 12814e9bbf6be..7e2b9ad454930 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -348,7 +348,7 @@ __gitcomp ()
 
 # Clear the variables caching builtins' options when (re-)sourcing
 # the completion script.
-if [[ -n ${ZSH_VERSION-} ]]; then
+if [[ -n ${ZSH_NAME-} ]]; then
 	unset $(set |sed -ne 's/^\(__gitcomp_builtin_[a-zA-Z0-9_][a-zA-Z0-9_]*\)=.*/\1/p') 2>/dev/null
 else
 	unset $(compgen -v __gitcomp_builtin_)

--
https://github.com/git/git/pull/500
Next: Junio C Hamano
Message 1 of 7 in “Use ZSH_NAME instead of ZSH_VERSION because it's redefined by git-completion.zsh”
  1. Use ZSH_NAME instead of ZSH_VERSION because it's redefined by git-completion.zshRick van Hattem, Jun 3, 2018
  2. Junio C HamanoJun 4, 2018
  3. Rick van HattemJun 4, 2018
  4. SZEDER GáborJun 6, 2018
  5. Rick van HattemJun 6, 2018
  6. Jonathan NiederJun 7, 2018
  7. Junio C HamanoJun 11, 2018

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.