* [RFC] Case insensitive URL rewrite
@ 2015-12-11 13:45 Lars Schneider
2015-12-11 14:38 ` Daniel Stenberg
2015-12-11 18:26 ` Junio C Hamano
0 siblings, 2 replies; 6+ messages in thread
From: Lars Schneider @ 2015-12-11 13:45 UTC (permalink / raw)
To: Git Users
Hi,
the "url.<someURL>.insteadOf" git config is case sensitive. I understand that this makes sense on case sensitive file systems. However, URLs are mostly case insensitive:
Consider this:
git clone https://GIThub.com/GIT/GIT
git clone https://github.com/git/git
Both commands will clone the same repository.
Interestingly enough this works, too:
git clone git@GIThub.com:GIT/GIT
What do you think about a flag that makes these rewrites case insensitive? E.g. with the following config flag:
[url "<actual url base>"]
insteadOf = <other url base>
ignorecase = true
Thanks,
Lars
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] Case insensitive URL rewrite
2015-12-11 13:45 [RFC] Case insensitive URL rewrite Lars Schneider
@ 2015-12-11 14:38 ` Daniel Stenberg
2015-12-11 18:26 ` Junio C Hamano
1 sibling, 0 replies; 6+ messages in thread
From: Daniel Stenberg @ 2015-12-11 14:38 UTC (permalink / raw)
To: Lars Schneider; +Cc: Git Users
On Fri, 11 Dec 2015, Lars Schneider wrote:
> the "url.<someURL>.insteadOf" git config is case sensitive. I understand
> that this makes sense on case sensitive file systems. However, URLs are
> mostly case insensitive:
Minor detail here perhaps, but...
I would object to URLs being "mostly case insensitive", even if github
apparently seems to work that way. The path part of URLs are rarely case
insensitive since it tends to map to a *nix file system, while the host name
part is insensitive as section 3.2.2 in RFC 3986 says.
--
/ daniel.haxx.se
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] Case insensitive URL rewrite
2015-12-11 13:45 [RFC] Case insensitive URL rewrite Lars Schneider
2015-12-11 14:38 ` Daniel Stenberg
@ 2015-12-11 18:26 ` Junio C Hamano
2015-12-11 18:51 ` Stefan Beller
2015-12-11 19:15 ` Jeff King
1 sibling, 2 replies; 6+ messages in thread
From: Junio C Hamano @ 2015-12-11 18:26 UTC (permalink / raw)
To: Lars Schneider; +Cc: Git Users
Lars Schneider <larsxschneider@gmail.com> writes:
> What do you think about a flag that makes these rewrites case insensitive? E.g. with the following config flag:
>
> [url "<actual url base>"]
> insteadOf = <other url base>
> ignorecase = true
I am with Daniel on this.
It is perfectly fine to consider these two equivalent.
git clone https://github.com/git/git (canonical one)
git clone https://GitHub.com/git/git (host part in funny case)
In fact, I think we should do this without any additional
configuration variable.
On the other hand, these two MUST be treated as different by
default:
git clone https://github.com/GIT/GIT (differences outside host part)
git clone git@github.com:GIT/GIT (differences outside host part)
Although I am OK if this is hidden behind a configuration variable,
I am not sure how much value you would be giving to the users.
In any case, I expect that additional change (on top of what is
required to make hostname part treated case insensitively) would not
be too bad, if we were going to fix the hostname part.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] Case insensitive URL rewrite
2015-12-11 18:26 ` Junio C Hamano
@ 2015-12-11 18:51 ` Stefan Beller
2015-12-11 18:56 ` Junio C Hamano
2015-12-11 19:15 ` Jeff King
1 sibling, 1 reply; 6+ messages in thread
From: Stefan Beller @ 2015-12-11 18:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Lars Schneider, Git Users
On Fri, Dec 11, 2015 at 10:26 AM, Junio C Hamano <gitster@pobox.com> wrote:
> On the other hand, these two MUST be treated as different by
> default:
>
> git clone https://github.com/GIT/GIT (differences outside host part)
> git clone git@github.com:GIT/GIT (differences outside host part)
This is one of the more obvious examples I would think as the protocol is
different. What about:
git clone git@example.com:git/git (differences outside host part)
git clone git@example.com:GIT/GIT (differences outside host part)
If the host has a filesystem which respects capitalization, these may be
two different repositories.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] Case insensitive URL rewrite
2015-12-11 18:51 ` Stefan Beller
@ 2015-12-11 18:56 ` Junio C Hamano
0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2015-12-11 18:56 UTC (permalink / raw)
To: Stefan Beller; +Cc: Lars Schneider, Git Users
Stefan Beller <sbeller@google.com> writes:
> On Fri, Dec 11, 2015 at 10:26 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> On the other hand, these two MUST be treated as different by
>> default:
>>
>> git clone https://github.com/GIT/GIT (differences outside host part)
>> git clone git@github.com:GIT/GIT (differences outside host part)
>
> This is one of the more obvious examples I would think as the protocol is
> different.
Oh, I should have been more careful; I did not think Lars meant
git@GitHub.com should somehow match https://github.com but a more
obvious "git@github.com:GIT/GIT and git@GitHub.com:git/git behave
the same", and I thought everybody who read it understood the
example as such.
> What about:
>
> git clone git@example.com:git/git (differences outside host part)
> git clone git@example.com:GIT/GIT (differences outside host part)
>
> If the host has a filesystem which respects capitalization, these may be
> two different repositories.
That is what I meant. Thanks for clarification.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] Case insensitive URL rewrite
2015-12-11 18:26 ` Junio C Hamano
2015-12-11 18:51 ` Stefan Beller
@ 2015-12-11 19:15 ` Jeff King
1 sibling, 0 replies; 6+ messages in thread
From: Jeff King @ 2015-12-11 19:15 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Lars Schneider, Git Users
On Fri, Dec 11, 2015 at 10:26:41AM -0800, Junio C Hamano wrote:
> Lars Schneider <larsxschneider@gmail.com> writes:
>
> > What do you think about a flag that makes these rewrites case insensitive? E.g. with the following config flag:
> >
> > [url "<actual url base>"]
> > insteadOf = <other url base>
> > ignorecase = true
>
> I am with Daniel on this.
>
> It is perfectly fine to consider these two equivalent.
>
> git clone https://github.com/git/git (canonical one)
> git clone https://GitHub.com/git/git (host part in funny case)
>
> In fact, I think we should do this without any additional
> configuration variable.
>
> On the other hand, these two MUST be treated as different by
> default:
>
> git clone https://github.com/GIT/GIT (differences outside host part)
> git clone git@github.com:GIT/GIT (differences outside host part)
I haven't looked, but the code in urlmatch.c probably gets all of this
right already. It was written much later than the insteadOf code, as it
was part of the http.$url.* matching, and it may be reasonable to simply
teach the insteadOf code to use it. OTOH, it may need tweaked because
I'm not sure how it would handle non-URLs like the "host:path" ssh form.
-Peff
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-12-11 19:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-11 13:45 [RFC] Case insensitive URL rewrite Lars Schneider
2015-12-11 14:38 ` Daniel Stenberg
2015-12-11 18:26 ` Junio C Hamano
2015-12-11 18:51 ` Stefan Beller
2015-12-11 18:56 ` Junio C Hamano
2015-12-11 19:15 ` Jeff King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).