Re: [PATCH v7 2/2] config: include file if remote URL matches a glob
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Jan 10, 2022, 18:58 UTC
- Message-ID
- <20220110185830.1115343-1-jonathantanmy@google.com>
- In-Reply-To
- <CABPp-BF+_33zR-vwh-tMTG=vxuah5jyuJVXssa-vAH51qdsrDQ@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 23 quoted lines
> > +test_expect_success 'includeIf.hasconfig:remote.*.url' ' > > + git init hasremoteurlTest && > > + test_when_finished "rm -rf hasremoteurlTest" && > > + > > + cat >include-this <<-\EOF && > > + [user] > > + this = this-is-included > > + EOF > > + cat >dont-include-that <<-\EOF && > > + [user] > > + that = that-is-not-included > > + EOF > > + cat >>hasremoteurlTest/.git/config <<-EOF && > > + [includeIf "hasconfig:remote.*.url:foo"] > > + path = "$(pwd)/include-this" > > + [includeIf "hasconfig:remote.*.url:bar"] > > + path = "$(pwd)/dont-include-that" > > + [remote "foo"] > > + url = foo > > Which "foo" is relevant here? The remote name, or the url value? > Could they be given different values so that the testcase is a bit > easier to read and understand?
Thanks for taking a look. Sorry for the late reply - I just got back from vacation.
This is a good point - I'll change one of them.
Show 14 quoted lines
> > +test_expect_success 'includeIf.hasconfig:remote.*.url respects last-config-wins' ' > > + git init hasremoteurlTest && > > + test_when_finished "rm -rf hasremoteurlTest" && > > + > > + cat >include-two-three <<-\EOF && > > + [user] > > + two = included-config > > + three = included-config > > + EOF > > + cat >>hasremoteurlTest/.git/config <<-EOF && > > + [remote "foo"] > > + url = foo > > ...similarly here.
Noted.
> The testcases are very helpful. I found myself confused when reading > just the documentation about how it would be used. Perhaps an example > or two should be added to the documentation?
Will do. I notice that there is a section with examples - I'll add it there.