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>maint
parent
359da658ae
commit
07aed58017
|
@ -410,6 +410,8 @@ include::config/i18n.txt[]
|
||||||
|
|
||||||
include::config/imap.txt[]
|
include::config/imap.txt[]
|
||||||
|
|
||||||
|
include::config/includeif.txt[]
|
||||||
|
|
||||||
include::config/index.txt[]
|
include::config/index.txt[]
|
||||||
|
|
||||||
include::config/init.txt[]
|
include::config/init.txt[]
|
||||||
|
|
|
@ -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
|
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_expect_success 'git config - variable name' '
|
||||||
test_completion "git config log.d" <<-\EOF
|
test_completion "git config log.d" <<-\EOF
|
||||||
log.date Z
|
log.date Z
|
||||||
|
@ -2338,6 +2345,12 @@ test_expect_success 'git config - variable name' '
|
||||||
EOF
|
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_expect_success 'git config - value' '
|
||||||
test_completion "git config color.pager " <<-\EOF
|
test_completion "git config color.pager " <<-\EOF
|
||||||
false Z
|
false Z
|
||||||
|
|
Loading…
Reference in New Issue