{"thread":{"id":"52775","subject":"URL rewrites for submodules","startedAt":"2020-02-10T21:02:07Z","lastAt":"2020-02-12T01:36:02Z","messageCount":4,"participants":["Toon Claes","Junio C Hamano","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"391492","messageId":"87wo8ucgar.fsf@iotcl.com","threadId":"52775","inReplyTo":null,"subject":"URL rewrites for submodules","fromName":"Toon Claes","fromEmail":"toon@iotcl.com","sentAt":"2020-02-10T20:56:28Z","receivedAt":"2020-02-10T21:02:07Z","isPatch":false,"sender":{"key":"toon@iotcl.com","avatar":"https://avatars.githubusercontent.com/u/121621?v=4"},"body":"Hi,\n\nI recently learned about rewriting URLs. Pretty cool feature. Learned\nabout it here:\nhttps://jonhnnyweslley.net/blog/how-to-rewrite-git-urls-to-clone-faster-and-push-safer/ \n\nBut I've been doing some testing, and this feature does not seem to work\nfor git submodules. Is it like that by design, so are there technical or\npractical limitation why we would not like to have this feature on\nsubmodules too?\n\nIf it's not by design, would you consider a contribution adding this\nfeature? What should I then pay attention at? For example, should there\nbe an option to enable/disable it for submodules, something like:\n\n[url \"http://new.url.example.com\"]\n     insteadOf = \"old.url.example.com\"\n     submodules = true\n\n\n--\nToon\n"},{"id":"391496","messageId":"xmqqv9oexfnr.fsf@gitster-ct.c.googlers.com","threadId":"52775","inReplyTo":"87wo8ucgar.fsf@iotcl.com","subject":"Re: URL rewrites for submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-02-10T22:04:40Z","receivedAt":"2020-02-10T22:04:49Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Toon Claes <toon@iotcl.com> writes:\n\n> Hi,\n>\n> I recently learned about rewriting URLs. Pretty cool feature. Learned\n> about it here:\n> https://jonhnnyweslley.net/blog/how-to-rewrite-git-urls-to-clone-faster-and-push-safer/ \n>\n> But I've been doing some testing, and this feature does not seem to work\n> for git submodules. Is it like that by design, so are there technical or\n> practical limitation why we would not like to have this feature on\n> submodules too?\n\nWouldn't these submodules have their own .git/config where you can\ndefine the rewrite rules?  It depends on why you use the rewriting\nrules but some common reasons why you rewrite URL A to URL B would\napply regardless of which project hosted at A you are accessing,\nnamely, performance and convenience.  And in such a case, you do not\nnecessarily want to have the rewrite config in the per-repository\nconfiguration file of the top-level superproject.  If you define\nthem instead in $HOME/.gitconfig, that would apply equally to all\nrepositories you would access.\n"},{"id":"391579","messageId":"87sgjgdeh5.fsf@iotcl.com","threadId":"52775","inReplyTo":"xmqqv9oexfnr.fsf@gitster-ct.c.googlers.com","subject":"Re: URL rewrites for submodules","fromName":"Toon Claes","fromEmail":"toon@iotcl.com","sentAt":"2020-02-11T21:02:46Z","receivedAt":"2020-02-11T21:02:59Z","isPatch":false,"sender":{"key":"toon@iotcl.com","avatar":"https://avatars.githubusercontent.com/u/121621?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> If you define them instead in $HOME/.gitconfig, that would apply\n> equally to all repositories you would access.\n\nYes, that makes sense to me too. But in my testing adding URL rewrites\ndid not apply to submodules anyway. So that feels to me this feature is\nmissing, WDYT?\n\n-- \nToon\n"},{"id":"391587","messageId":"20200212013537.GA18770@google.com","threadId":"52775","inReplyTo":"87sgjgdeh5.fsf@iotcl.com","subject":"Re: URL rewrites for submodules","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2020-02-12T01:35:37Z","receivedAt":"2020-02-12T01:36:02Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nToon Claes wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n\n>> If you define them instead in $HOME/.gitconfig, that would apply\n>> equally to all repositories you would access.\n>\n> Yes, that makes sense to me too. But in my testing adding URL rewrites\n> did not apply to submodules anyway.\n\nHm, that doesn't match my experience --- I've been able to use URL\nrewrite rules reliably.\n\nDo you have a sequence of commands I can run to reproduce the issue\nyou're running into?\n\nThanks and hope that helps,\nJonathan\n"}]}