git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Raphael Stolt <raphael.stolt@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: "Sebastian Schuberth" <sschuberth@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: Wed, 10 May 2017 23:21:57 +0200	[thread overview]
Message-ID: <CC77A0CE-88A5-4A3C-97AF-ED0180FE385B@gmail.com> (raw)
In-Reply-To: <CACBZZX7CgeW1OK+g9Mbir62MMaCx4sHFZngUuWz_H241Sb355g@mail.gmail.com>

> 
> Am 10.05.2017 um 21:48 schrieb Ævar Arnfjörð Bjarmason <avarab@gmail.com>:
> 
> On Wed, May 10, 2017 at 8:58 PM, Sebastian Schuberth
> <sschuberth@gmail.com> wrote:
>> On 2017-05-10 19:00, raphael.stolt@gmail.com wrote:
>> 
>>> Current configuration which finds the conditional configuration.
>>> 

a)

>>> ~/.gitconfig
>>> [includeIf "gitdir:~/Work/git-repos/oss/"]
>>>   path = ~/Work/git-repos/oss/.oss-gitconfig
>>> 
>>> Expected configuration which doesn't find the conditional configuration:
>>> 

b)

>>> ~/.gitconfig
>>> [includeIf "gitdir:~/Work/git-repos/oss/"]
>>>   path = .oss-gitconfig
>> 
>> 
>> My guess is, because includeIf might contain other conditionals than
>> "gitdir", the generic convention is to always use an absolute path for
>> "path".
> 
> [CC'd OP Raphael Stolt, please reply-all]
> 
> In both cases the conditional is the same, but the path is relative
> v.s. absolute.
> 
> Raphael: Does the config get included if you cd to
> ~/Work/git-repos/oss/? From git-config(1):

Given I’m in a repo in ~/Work/git-repos/oss/ e.g. ~/Work/git-repos/oss/project-repo-a and I’m using config a) 
the config is used from ~/Work/git-repos/oss/.oss-gitconfig

Given I’m in a repo in ~/Work/git-repos/oss/ e.g. ~/Work/git-repos/oss/project-repo-a and I’m using config b) 
the global config is used because there is no .oss-gitconfig in $HOME.

I guess it’s an intended behavior since conditional configuration files __SHOULD__ reside in $HOME rather than 
in my case in ~/Work/git-repos/oss.

> 
> ---cut---
> 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
> be relative to the configuration file in which the include directive
> was found.  See below for examples.
> ---cut---
> 
> The commit that added IncludeIf (3efd0bedc6) does something with
> relative path (just skimming, need to get to other things), but unlike
> [Include] the docs don't explicitly mention what it's supposed to do
> with that, and all the examples show absolute paths.
> 
> So whether this is a bug in the code or not it seems to definitely be
> a doc bug, whatever it does with relative files should be in the docs.
+ 1

  reply	other threads:[~2017-05-10 21:22 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 [this message]
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
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

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

  git send-email \
    --in-reply-to=CC77A0CE-88A5-4A3C-97AF-ED0180FE385B@gmail.com \
    --to=raphael.stolt@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@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.
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 NNTP newsgroup(s).