Skip to content

Commit 9d71d94

Browse files
peffgitster
authored andcommitted
docs/config: clarify include/includeIf relationship
The "includeIf" directives behave exactly like include ones, except they only kick in when the conditional is true. That was mentioned in the "conditional" section, but let's make it more clear for the whole "includes" section, since people don't necessarily read the documentation top to bottom. Signed-off-by: Jeff King <[email protected]> Reviewed-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b06d364 commit 9d71d94

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Documentation/config.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,20 @@ escape sequences) are invalid.
7979
Includes
8080
~~~~~~~~
8181

82+
The `include` and `includeIf` sections allow you to include config
83+
directives from another source. These sections behave identically to
84+
each other with the exception that `includeIf` sections may be ignored
85+
if their condition does not evaluate to true; see "Conditional includes"
86+
below.
87+
8288
You can include a config file from another by setting the special
83-
`include.path` variable to the name of the file to be included. The
84-
variable takes a pathname as its value, and is subject to tilde
85-
expansion. `include.path` can be given multiple times.
89+
`include.path` (or `includeIf.*.path`) variable to the name of the file
90+
to be included. The variable takes a pathname as its value, and is
91+
subject to tilde expansion. These variables can be given multiple times.
8692

8793
The included file is expanded immediately, as if its contents had been
8894
found at the location of the include directive. If the value of the
89-
`include.path` variable is a relative path, the path is considered to
95+
variable is a relative path, the path is considered to
9096
be relative to the configuration file in which the include directive
9197
was found. See below for examples.
9298

@@ -95,8 +101,7 @@ Conditional includes
95101

96102
You can include a config file from another conditionally by setting a
97103
`includeIf.<condition>.path` variable to the name of the file to be
98-
included. The variable's value is treated the same way as
99-
`include.path`. `includeIf.<condition>.path` can be given multiple times.
104+
included.
100105

101106
The condition starts with a keyword followed by a colon and some data
102107
whose format and meaning depends on the keyword. Supported keywords

0 commit comments

Comments
 (0)