Web lists-archives.com

Re: insteadOf and git-request-pull output

Jeff King <peff@xxxxxxxx> writes:

> I suspect it would be less confusing if the rewrite were inverted, like:
>   [url "gh:"]
>   rewriteTo = https://github.com
>   rewritePrivate
>   [url "git://github.com"]
>   rewriteTo = https://github.com
> where the mapping of sections to rewrite rules must be one-to-one, not
> one-to-many (and you can see that the flip side is that we have to
> repeat ourselves).
> I hate to introduce two ways of doing the same thing, but maybe it is
> simple enough to explain that url.X.insteadOf=Y is identical to
> url.Y.rewriteTo=X. I do think people have gotten confused by the
> ordering of insteadOf over the years, so this would let them specify it
> in whichever way makes the most sense to them.

I do admit that the current "insteadOf" was too cute a way to
configure this feature and I often have to read it aloud twice
before convincing myself I got X and Y right.  It would have been
cleaner if the definition were in the opposite direction, exactly
because you can rewrite a single thing into just one way, but we do
want to support that many things mapping to the same, and the
approach to use "url.Y.rewriteTo=X" does express it better.