Re: insteadOf and git-request-pull output
- Date: Sat, 17 Nov 2018 16:46:22 +0900
- From: Junio C Hamano <gitster@xxxxxxxxx>
- Subject: Re: insteadOf and git-request-pull output
"brian m. carlson" <sandals@xxxxxxxxxxxxxxxxxxxx> writes:
>> $ git request-pull HEAD^ git://foo.example.com/example | grep example
>> I think that if we use the "principle of least surprise," insteadOf
>> rules shouldn't be applied for git-request-pull URLs.
> I'd like to point out a different use that may change your view. I have
> an insteadOf alias, gh:, that points to GitHub. Performing the rewrite
> is definitely the right thing to do, since other users may not have my
> alias available.
> I agree that in your case, a rewrite seems less appropriate, but I think
> we should only skip the rewrite if the value already matches a valid
It would be tricky to define what a valid URL is, though. Do we
need some way to say "this is a private URL that should not be
given preference when composing a request-pull message"? E.g.
insteadOf = https://git.dev/
insteadOf = gh:
The former does not mark https://git.dev/ a private one, so a
"request-pull https://git.dev/$thing" would show the original
"https://git.dev/$thing" without rewriting. The latter marks gh: a
private one so "request-pull gh:$thing" would be rewritten before
exposed to the public as "https://github.com/$thing"
Or something like that?