git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Manuel Boni <ziosombrero@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Missing completions for the 'config' subcommand
Date: Tue, 28 Jun 2022 09:39:47 +0200	[thread overview]
Message-ID: <220628.86a69xgro2.gmgdl@evledraar.gmail.com> (raw)
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


      reply	other threads:[~2022-06-28  7:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28  5:49 Missing completions for the 'config' subcommand Manuel Boni
2022-06-28  7:39 ` Ævar Arnfjörð Bjarmason [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=220628.86a69xgro2.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ziosombrero@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).