]> git.ipfire.org Git - thirdparty/git.git/commit - t/t9902-completion.sh
completion: complete values of configuration variables after 'git -c var='
authorSZEDER Gábor <szeder.dev@gmail.com>
Tue, 13 Aug 2019 12:26:50 +0000 (14:26 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Aug 2019 19:31:04 +0000 (12:31 -0700)
commitdd33472831756895a86153c651c18580a6dccbc8
tree03efbb35cd3556f8d2272343b977176e2b18c034
parente1e00089da9f616d23f0ca3bb183258e9013c469
completion: complete values of configuration variables after 'git -c var='

'git config' expects a configuration variable's name and value in
separate options, so we complete values as they stand on their own on
the command line.  'git -c', however, expects them in a single option
joined by a '=' character, so we should be able to complete values
when they are following 'section.name=' in the same word.

Add new options to the __git_complete_config_variable_value() function
to allow callers to specify the current word to be completed and the
configuration variable whose value is to be completed, and use these
to complete possible values after 'git -c 'section.name=<TAB>'.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash
t/t9902-completion.sh