git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: "Sebastian Schuberth" <sschuberth@gmail.com>,
	"Raphael Stolt" <raphael.stolt@gmail.com>,
	"Git Mailing List" <git@vger.kernel.org>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: Possible bug in includeIf / conditional includes
Date: Thu, 11 May 2017 03:54:37 -0400	[thread overview]
Message-ID: <20170511075437.yjxs6oit7ibe7rkq@sigill.intra.peff.net> (raw)
In-Reply-To: <CACBZZX6hpL0=Zw0kvB-Ww95uGvuJ8129MTwkmv7DOEE1i66a_Q@mail.gmail.com>

On Thu, May 11, 2017 at 09:49:09AM +0200, Ævar Arnfjörð Bjarmason wrote:

> > I don't like this because it copies the rules for _one_ property to the
> > conditional section. What happens when you're looking for some other
> > property of include.path?
> 
> Yeah, as I said once I wrote it up I found it wasn't really any
> better, but just wanted to send an explanation for why I didn't find
> it while I remembered, as a sort of case study.
> [...]
> > I suspect that whole paragraph under Includes could be reworded to make
> > it clear that anything it is saying applies equally to include.$key and
> > includeIf.*.$key, and then that would future-proof us for other
> > modifications.

What about this:

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 475e874d5..e44ad21eb 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -80,13 +80,13 @@ Includes
 ~~~~~~~~
 
 You can include a config file from another by setting the special
-`include.path` variable to the name of the file to be included. The
-variable takes a pathname as its value, and is subject to tilde
-expansion. `include.path` can be given multiple times.
+`include.path` and `includeIf.*.path` variables to the name of the file
+to be included. The variable takes a pathname as its value, and is
+subject to tilde expansion. These variables can be given multiple times.
 
 The included file is expanded immediately, as if its contents had been
 found at the location of the include directive. If the value of the
-`include.path` variable is a relative path, the path is considered to
+variable is a relative path, the path is considered to
 be relative to the configuration file in which the include directive
 was found.  See below for examples.
 
@@ -95,8 +95,7 @@ Conditional includes
 
 You can include a config file from another conditionally by setting a
 `includeIf.<condition>.path` variable to the name of the file to be
-included. The variable's value is treated the same way as
-`include.path`. `includeIf.<condition>.path` can be given multiple times.
+included (see the "Includes" section above for more details).
 
 The condition starts with a keyword followed by a colon and some data
 whose format and meaning depends on the keyword. Supported keywords

  reply	other threads:[~2017-05-11  7:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 17:00 Possible bug in includeIf / conditional includes raphael.stolt
2017-05-10 18:58 ` Sebastian Schuberth
2017-05-10 19:48   ` Ævar Arnfjörð Bjarmason
2017-05-10 21:21     ` Raphael Stolt
2017-05-10 21:37       ` Raphael Stolt
2017-05-11  6:26     ` Jeff King
2017-05-11  6:29       ` Jeff King
2017-05-11  7:19         ` Ævar Arnfjörð Bjarmason
2017-05-11  7:42           ` Jeff King
2017-05-11  7:49             ` Ævar Arnfjörð Bjarmason
2017-05-11  7:54               ` Jeff King [this message]
2017-05-11  9:09                 ` [PATCH 0/4] doc improvements for config includes Jeff King
2017-05-11  9:10                   ` [PATCH 1/4] docs/config: clarify include/includeIf relationship Jeff King
2017-05-11 16:47                     ` Ramsay Jones
2017-05-12  9:28                       ` Jeff King
2017-05-11  9:11                   ` [PATCH 2/4] docs/config: give a relative includeIf example Jeff King
2017-05-11  9:13                   ` [PATCH 3/4] docs/config: avoid the term "expand" for includes Jeff King
2017-05-11  9:14                   ` [PATCH 4/4] docs/config: consistify include.path examples Jeff King
2017-05-11  9:41                     ` Junio C Hamano
2017-05-11  9:29                   ` [PATCH 0/4] doc improvements for config includes Ævar Arnfjörð Bjarmason
2017-05-11  7:54             ` Possible bug in includeIf / conditional includes Junio C Hamano
2017-05-11  7:56               ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170511075437.yjxs6oit7ibe7rkq@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=raphael.stolt@gmail.com \
    --cc=sschuberth@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).