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

[PATCH] completion: treat unset GIT_COMPLETION_SHOW_ALL gracefully

From
Ville Skyttä <ville.skytta@iki.fi>
Date
Apr 6, 2021, 18:12 UTC
Message-ID
<20210406181247.250046-1-ville.skytta@iki.fi>

If not set, referencing it in nounset (set -u) mode unguarded produces an error.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
---
 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 e1a66954fe..6d77f56f92 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -427,7 +427,7 @@ __gitcomp_builtin ()
 
 	if [ -z "$options" ]; then
 		local completion_helper
-		if [ "$GIT_COMPLETION_SHOW_ALL" = "1" ]; then
+		if [ "${GIT_COMPLETION_SHOW_ALL-}" = "1" ]; then
 			completion_helper="--git-completion-helper-all"
 		else
 			completion_helper="--git-completion-helper"
-- 
2.25.1
Next: Junio C Hamano
Message 1 of 3 in “completion: treat unset GIT_COMPLETION_SHOW_ALL gracefully”
  1. completion: treat unset GIT_COMPLETION_SHOW_ALL gracefullyVille Skyttä, Apr 6, 2021
  2. Junio C HamanoApr 6, 2021
  3. Ville SkyttäApr 8, 2021

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.