Re: Possible bug in includeIf / conditional includes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> Am 10.05.2017 um 21:48 schrieb Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>:
> 
> On Wed, May 10, 2017 at 8:58 PM, Sebastian Schuberth
> <sschuberth@xxxxxxxxx> wrote:
>> On 2017-05-10 19:00, raphael.stolt@xxxxxxxxx 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]