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

Re: Missing completions for the 'config' subcommand

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 28, 2022, 07:39 UTC
Message-ID
<220628.86a69xgro2.gmgdl@evledraar.gmail.com>
In-Reply-To
<CAKP36g5G6KBEn8C+H8rxj5atfm2RKTfLAPtVveqg-8r4nqbxRg@mail.gmail.com>
On Tue, Jun 28 2022, Manuel Boni wrote:
Show 33 quoted lines
> What did you do before the bug happened? (Steps to reproduce your issue)
> 1) Start Git Bash, and optionally use 'set -x';
> 2) type 'git config incl';
> 3) attempt to tab-complete the last word.
>
> What did you expect to happen? (Expected behavior)
> The list of available completions should include the 'include' and
> 'includeIf' expressions.
>
> What happened instead? (Actual behavior)
> The expressions mentioned previously are not present.
>
> What's different between what you expected and what actually happened?
> The list of completions for the 'config' subcommand does not contain
> all the available sections.
>
> [System Info]
> git version:
> git version 2.36.1.windows.1
> cpu: x86_64
> built from commit: e2ff68a2d1426758c78d023f863bfa1e03cbc768
> sizeof-long: 4
> sizeof-size_t: 8
> shell-path: /bin/sh
> feature: fsmonitor--daemon
> uname: Windows 10.0 19044
> compiler info: gnuc: 11.3
> libc info: no libc information available
> $SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe
>
>
> [Enabled Hooks]
> not run from a git repository - no hooks to show
Something like this patch would fix this, since we just generate this
completion list by scraping Documentation/config/*.txt. See
generate-configlist.sh at the top-level:
	
	diff --git a/Documentation/config/includeif.txt b/Documentation/config/includeif.txt
	new file mode 100644
	index 00000000000..7f7513e9197
	--- /dev/null
	+++ b/Documentation/config/includeif.txt
	@@ -0,0 +1,5 @@
	+include.path::
	+includeIf.<condition>.path::
	+	Special variables to include other configuration files. See
	+	the "CONFIGURATION FILE" section in the main
	+	linkgit:git-config[1] documentation.
If you're willing to make this your first patch to git.git that would be
great:) I think this with something to give it basic test coverage would
be nice, you could use these tests as a template:
	
	$ git grep 'git config' -- t/t9902-completion.sh
	t/t9902-completion.sh:test_expect_success 'git config - section' '
	t/t9902-completion.sh:  test_completion "git config br" <<-\EOF
	t/t9902-completion.sh:test_expect_success 'git config - variable name' '
	t/t9902-completion.sh:  test_completion "git config log.d" <<-\EOF
	t/t9902-completion.sh:test_expect_success 'git config - value' '
	t/t9902-completion.sh:  test_completion "git config color.pager " <<-\EOF
Previous: Manuel Boni
Message 2 of 2 in “Missing completions for the 'config' subcommand”
  1. Manuel BoniJun 28, 2022
  2. Ævar Arnfjörð BjarmasonJun 28, 2022

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.