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

contrib/completion/git-completion.bash: declare -g is not portable

From
Torsten Bögershausen <tboegi@web.de>
Date
Feb 3, 2018, 17:20 UTC
Message-ID
<1e618c0c-81ba-fa7e-8039-748bdfa5a6d9@web.de>

Hej Duy, After running t9902-completion.sh on Mac OS I got a failure in this style:

.../projects/git/git.pu/t/../contrib/completion/git-completion.bash: line 300: declare: -g: invalid option declare: usage: declare [-afFirtx] [-p] [name[=value] ...] --- expected 2018-02-03 17:10:18.000000000 +0000 +++ out 2018-02-03 17:10:18.000000000 +0000

@@ -1,15 +1,2 @@
---quiet
---detach
---track
---orphan=
---ours
---theirs
---merge
---conflict=
---patch
---ignore-skip-worktree-bits
---ignore-other-worktrees
---recurse-submodules
---progress
 --no-track
 --no-recurse-submodules
not ok 92 - double dash "git checkout"

What is "declare -g" good for ?

<https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html#index-declare>
Next: Andreas Schwab
Message 1 of 6 in “contrib/completion/git-completion.bash: declare -g is not portable”
  1. Torsten BögershausenFeb 3, 2018
  2. Andreas SchwabFeb 3, 2018
  3. Jeff KingFeb 3, 2018
  4. Duy NguyenFeb 4, 2018
  5. Eric SunshineFeb 4, 2018
  6. Lucas WerkmeisterFeb 4, 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.