config.txt: document include, includeIf
Git config's tab completion does not yet know about the "include" and "includeIf" sections, nor the related "path" variable. Add a description for these two sections in 'Documentation/config/includeif.txt', which points to git-config's documentation, specifically the "Includes" and "Conditional Includes" subsections. As a side effect, tab completion can successfully complete the 'include', 'includeIf', and 'include.add' expressions. This effect is tested by two new ad-hoc tests. Variable completion only works for "include" for now. Credit for the ideas behind this patch goes to Ævar Arnfjörð Bjarmason. Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Manuel Boni <ziosombrero@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
359da658ae
commit
07aed58017
@ -410,6 +410,8 @@ include::config/i18n.txt[]
|
||||
|
||||
include::config/imap.txt[]
|
||||
|
||||
include::config/includeif.txt[]
|
||||
|
||||
include::config/index.txt[]
|
||||
|
||||
include::config/init.txt[]
|
||||
|
6
Documentation/config/includeif.txt
Normal file
6
Documentation/config/includeif.txt
Normal file
@ -0,0 +1,6 @@
|
||||
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,
|
||||
specifically the "Includes" and "Conditional Includes" subsections.
|
@ -2330,6 +2330,13 @@ test_expect_success 'git config - section' '
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success 'git config - section include, includeIf' '
|
||||
test_completion "git config inclu" <<-\EOF
|
||||
include.Z
|
||||
includeIf.Z
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success 'git config - variable name' '
|
||||
test_completion "git config log.d" <<-\EOF
|
||||
log.date Z
|
||||
@ -2338,6 +2345,12 @@ test_expect_success 'git config - variable name' '
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success 'git config - variable name include' '
|
||||
test_completion "git config include.p" <<-\EOF
|
||||
include.path Z
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success 'git config - value' '
|
||||
test_completion "git config color.pager " <<-\EOF
|
||||
false Z
|
||||
|
Loading…
Reference in New Issue
Block a user