git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* URL rewrites for submodules
@ 2020-02-10 20:56 Toon Claes
  2020-02-10 22:04 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Toon Claes @ 2020-02-10 20:56 UTC (permalink / raw)
  To: git

Hi,

I recently learned about rewriting URLs. Pretty cool feature. Learned
about it here:
https://jonhnnyweslley.net/blog/how-to-rewrite-git-urls-to-clone-faster-and-push-safer/ 

But I've been doing some testing, and this feature does not seem to work
for git submodules. Is it like that by design, so are there technical or
practical limitation why we would not like to have this feature on
submodules too?

If it's not by design, would you consider a contribution adding this
feature? What should I then pay attention at? For example, should there
be an option to enable/disable it for submodules, something like:

[url "http://new.url.example.com"]
     insteadOf = "old.url.example.com"
     submodules = true


--
Toon

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: URL rewrites for submodules
  2020-02-10 20:56 URL rewrites for submodules Toon Claes
@ 2020-02-10 22:04 ` Junio C Hamano
  2020-02-11 21:02   ` Toon Claes
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2020-02-10 22:04 UTC (permalink / raw)
  To: Toon Claes; +Cc: git

Toon Claes <toon@iotcl.com> writes:

> Hi,
>
> I recently learned about rewriting URLs. Pretty cool feature. Learned
> about it here:
> https://jonhnnyweslley.net/blog/how-to-rewrite-git-urls-to-clone-faster-and-push-safer/ 
>
> But I've been doing some testing, and this feature does not seem to work
> for git submodules. Is it like that by design, so are there technical or
> practical limitation why we would not like to have this feature on
> submodules too?

Wouldn't these submodules have their own .git/config where you can
define the rewrite rules?  It depends on why you use the rewriting
rules but some common reasons why you rewrite URL A to URL B would
apply regardless of which project hosted at A you are accessing,
namely, performance and convenience.  And in such a case, you do not
necessarily want to have the rewrite config in the per-repository
configuration file of the top-level superproject.  If you define
them instead in $HOME/.gitconfig, that would apply equally to all
repositories you would access.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: URL rewrites for submodules
  2020-02-10 22:04 ` Junio C Hamano
@ 2020-02-11 21:02   ` Toon Claes
  2020-02-12  1:35     ` Jonathan Nieder
  0 siblings, 1 reply; 4+ messages in thread
From: Toon Claes @ 2020-02-11 21:02 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> If you define them instead in $HOME/.gitconfig, that would apply
> equally to all repositories you would access.

Yes, that makes sense to me too. But in my testing adding URL rewrites
did not apply to submodules anyway. So that feels to me this feature is
missing, WDYT?

-- 
Toon

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: URL rewrites for submodules
  2020-02-11 21:02   ` Toon Claes
@ 2020-02-12  1:35     ` Jonathan Nieder
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Nieder @ 2020-02-12  1:35 UTC (permalink / raw)
  To: Toon Claes; +Cc: Junio C Hamano, git

Hi,

Toon Claes wrote:
> Junio C Hamano <gitster@pobox.com> writes:

>> If you define them instead in $HOME/.gitconfig, that would apply
>> equally to all repositories you would access.
>
> Yes, that makes sense to me too. But in my testing adding URL rewrites
> did not apply to submodules anyway.

Hm, that doesn't match my experience --- I've been able to use URL
rewrite rules reliably.

Do you have a sequence of commands I can run to reproduce the issue
you're running into?

Thanks and hope that helps,
Jonathan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 20:56 URL rewrites for submodules Toon Claes
2020-02-10 22:04 ` Junio C Hamano
2020-02-11 21:02   ` Toon Claes
2020-02-12  1:35     ` Jonathan Nieder

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git