From dd33472831756895a86153c651c18580a6dccbc8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?SZEDER=20G=C3=A1bor?= Date: Tue, 13 Aug 2019 14:26:50 +0200 Subject: [PATCH] completion: complete values of configuration variables after 'git -c var=' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit '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='. Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 65 ++++++++++++++++---------- t/t9902-completion.sh | 7 +++ 2 files changed, 48 insertions(+), 24 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 367b1c50f4..6f2bc60707 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2229,96 +2229,112 @@ __git_compute_config_vars () } # Completes possible values of various configuration variables. +# +# Usage: __git_complete_config_variable_value [