{"thread":{"id":"52211","subject":"[Improvement] Separate protocol and path in gitmodules","startedAt":"2019-11-07T13:52:42Z","lastAt":"2019-11-08T01:45:26Z","messageCount":2,"participants":["Benedek Rácz","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"385706","messageId":"CAAMvNNQyzMwAhizT-vBpbwfzAAHS6Ycx2tCLZ_eND3SK8WdTGg@mail.gmail.com","threadId":"52211","inReplyTo":null,"subject":"[Improvement] Separate protocol and path in gitmodules","fromName":"Benedek Rácz","fromEmail":"betontalpfa@gmail.com","sentAt":"2019-11-07T13:52:28Z","receivedAt":"2019-11-07T13:52:42Z","isPatch":false,"sender":{"key":"betontalpfa@gmail.com","avatar":null},"body":"Hi All,\n\n**The issue**\nMy problem is based on this post: https://stackoverflow.com/q/40841882/2506522\n\n**Use-case:**\nGit can be used with SSH or with HTTP. The usage of SSH is easier, due\nto automatic authentication (ssh-key). But I have to use git from a\npublic PC, where I mustn't store my ssh-keys. On that PC I want to use\nhttps's user/password authentication.\n\n**Suggestion**\nThe root-cause of this issue is that the protocol (SSH or HTTP) and\nthe path of the remote repository is stored together (in the\n.gitmodules file). If they were stored separately I would choose the\nprotocol easily.\n\nBenedek\n"},{"id":"385744","messageId":"20191108014518.GH32531@camp.crustytoothpaste.net","threadId":"52211","inReplyTo":"CAAMvNNQyzMwAhizT-vBpbwfzAAHS6Ycx2tCLZ_eND3SK8WdTGg@mail.gmail.com","subject":"Re: [Improvement] Separate protocol and path in gitmodules","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-11-08T01:45:18Z","receivedAt":"2019-11-08T01:45:26Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2019-11-07 at 13:52:28, Benedek Rácz wrote:\n> Hi All,\n> \n> **The issue**\n> My problem is based on this post: https://stackoverflow.com/q/40841882/2506522\n> \n> **Use-case:**\n> Git can be used with SSH or with HTTP. The usage of SSH is easier, due\n> to automatic authentication (ssh-key). But I have to use git from a\n> public PC, where I mustn't store my ssh-keys. On that PC I want to use\n> https's user/password authentication.\n\nYou can use the url.<base>.insteadOf feature to rewrite URLs, which will\ndo what you want in this case.\n\nFor example, I could set\nurl.https://git.crustytoothpaste.net/git/.insteadOf to\n\"ssh://bmc@git.crustytoothpaste.net/srv/scm/git/\".  That would rewrite\nthe SSH URLs for my Git server to an appropriate HTTPS URL.\n\nIt's designed for situations like this, when you know the rewriting\nrules better than an external system.\n\n> **Suggestion**\n> The root-cause of this issue is that the protocol (SSH or HTTP) and\n> the path of the remote repository is stored together (in the\n> .gitmodules file). If they were stored separately I would choose the\n> protocol easily.\n\nThe problem is that we don't know that a repository is accessible by\nboth of those methods, or even if it is, what the correspondence between\nthem is.\n\nFor example, my personal repositories are under\nhttps://git.crustytoothpaste.net/git/bmc/ and\nssh://bmc@git.crustytoothpaste.net/srv/scm/git/bmc/.  Those paths are\ncompletely different.  There's no way to intrinsically map from one to\nthe other without external knowledge.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"}]}