Re: Is it possible to use new conditional includes outside of git dir?
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- May 15, 2017, 21:00 UTC
- Message-ID
- <CACBZZX5z_jn3KnpgOBE=qa1cUcUAABPwuzqG81Ry0ztvMm4nAw@mail.gmail.com>
- In-Reply-To
- <b18ddd8e-5772-6351-6e49-78c1372077f1@gmail.com>
On Mon, May 15, 2017 at 8:09 PM, Mihails Strasuns <mihails.strasuns@gmail.com> wrote:
Show 20 quoted lines
> I was very excited to try out new conditional include feature but have > quickly found out that it doesn't work with some of my custom scripts > because of the following behaviour: > > # .gitconfig > [includeIf "gitdir:~/work/"] > path = ~/.gitconfig.work > [user] > name1 = Someone > > # .gitconfig.work > [user] > name2 = SomeoneElse > $ cd ~/work; git config user.name1 # "Someone" > $ cd ~/work ; git config user.name2 # <nothing> > > I see that it matches current `git config` documentation - indeed, it > mentions only matching on git directory and not arbitrary file path. I > wonder though, if this limitation is intentional and what is the > rationale behind it?
It's intentional, but in the "that's how this works" sense, not "we'll never add what you just asked for".
This came up on list last week: https://public-inbox.org/git/F55DC360-9C1E-45B9-B8BA-39E1001BD620@gmail.com/T/#u
So I'd like to ask you the same question I asked Raphael in that thread.