Re: url.<base>.insteadOf vs. submodules
- From
Stefan Beller <sbeller@google.com>
- Date
- Feb 22, 2017, 00:10 UTC
- Message-ID
- <CAGZ79kZRZz8h8cfrzsOPH+YT7QdF9vQ3C3XBZfGA1SaF+1mEzw@mail.gmail.com>
- In-Reply-To
- <20170221234037.ga44u3birwd5whab@sigill.intra.peff.net>
On Tue, Feb 21, 2017 at 3:40 PM, Jeff King <peff@peff.net> wrote:
Show 18 quoted lines
>> > One other caveat: I'm not sure if we do insteadOf recursively, but it >> > may be surprising to the child "git clone" that we've already applied >> > the insteadOf rewriting (especially if the rules are coming from >> > ~/.gitconfig and may be applied twice). >> >> When a rule is having effect twice the rule sounds broken. (the outcome >> ought to be sufficiently different from the original?) > > If you have: > > url.bar.insteadOf=foo > url.baz.insteadOf=bar > > do we convert "foo" to "baz"? If so, then I think applying the rules > again shouldn't matter. But if we don't, and only do a single level, > then having the caller rewrite the URL before it hands it to "git clone" > means we may end up unexpectedly doing two levels of rewriting. >
I see. Thanks for the example. So really what we want is to record the unencumbered URL (with no rewriting) and then at run time lookup various places of url.*.insteadOf (which might change with the git version that you use)
Thanks, Stefan