# Missing completions for the 'config' subcommand

2 messages from 2022-06-28 to 2022-06-28. Participants: Manuel Boni, Ævar Arnfjörð Bjarmason.
Thread: https://gitlist.dev/t/58076

## Manuel Boni, 2022-06-28 05:49

Subject: Missing completions for the 'config' subcommand
Message-ID: <CAKP36g5G6KBEn8C+H8rxj5atfm2RKTfLAPtVveqg-8r4nqbxRg@mail.gmail.com>
URL: https://gitlist.dev/e/CAKP36g5G6KBEn8C%2BH8rxj5atfm2RKTfLAPtVveqg-8r4nqbxRg%40mail.gmail.com

```
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

Thank you for your attention.

```

## Ævar Arnfjörð Bjarmason, 2022-06-28 07:39

Subject: Re: Missing completions for the 'config' subcommand
Message-ID: <220628.86a69xgro2.gmgdl@evledraar.gmail.com>
URL: https://gitlist.dev/e/220628.86a69xgro2.gmgdl%40evledraar.gmail.com
In-Reply-To: <CAKP36g5G6KBEn8C+H8rxj5atfm2RKTfLAPtVveqg-8r4nqbxRg@mail.gmail.com>

```

On Tue, Jun 28 2022, Manuel Boni wrote:

> 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


```
