{"thread":{"id":"47420","subject":"SSH port ignored when ssh:// prefix isn't specified","startedAt":"2017-12-10T20:23:50Z","lastAt":"2017-12-10T21:42:32Z","messageCount":3,"participants":["mqudsi@neosmart.net","Matthieu Moy","Randall S. Becker"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"334570","messageId":"0101016042190a3b-091dfab3-e010-4fbe-94e7-739ae3090883-000000@us-west-2.amazonses.com","threadId":"47420","inReplyTo":null,"subject":"SSH port ignored when ssh:// prefix isn't specified","fromName":"mqudsi@neosmart.net","fromEmail":"mqudsi@neosmart.net","sentAt":"2017-12-10T20:23:45Z","receivedAt":"2017-12-10T20:23:50Z","isPatch":false,"sender":{"key":"mqudsi@neosmart.net","avatar":"https://gravatar.com/avatar/c2643dd7c6df61aed49d9f3d917ac6d61cafbbda5f9b1619f50d3b749dca415a?d=mp&s=160"},"body":"Greetings,\n\nIt appears that for non-standard ports to be specified for ssh-based\nclones/checkouts, the leading \"ssh://\" prefix must be applied. I am unsure if\nthere's a reason for this or if it is simply an overlooked idiosyncrasy in the\nparser.\n\nBasically, while `git clone ssh://git@example.com:2222/path` works, the same\nwith the `ssh://` prefix doesn't, and attempts to establish a connection to\nport 22 instead: `git clone git@example.com:2222/path` (I'm not sure what it\nwill do with the `:2222` should the connection actually succeed).\n\nMahmoud Al-Qudsi\nNeoSmart Technologies\n\n"},{"id":"334571","messageId":"q7h9y3mamik4.fsf@orange.lip.ens-lyon.fr","threadId":"47420","inReplyTo":"0101016042190a3b-091dfab3-e010-4fbe-94e7-739ae3090883-000000@us-west-2.amazonses.com","subject":"Re: SSH port ignored when ssh:// prefix isn't specified","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@univ-lyon1.fr","sentAt":"2017-12-10T20:31:07Z","receivedAt":"2017-12-10T20:31:27Z","isPatch":false,"sender":{"key":"matthieu.moy@univ-lyon1.fr","avatar":"https://gravatar.com/avatar/8ab83b763226bd297b59ddd1463a8bfc852924577191233f73a953b86888fe0c?d=mp&s=160"},"body":"\"mqudsi@neosmart.net\" <mqudsi@neosmart.net> writes:\n\n> Basically, while `git clone ssh://git@example.com:2222/path` works, the same\n> with the `ssh://` prefix doesn't, and attempts to establish a connection to\n> port 22 instead: `git clone git@example.com:2222/path` (I'm not sure what it\n> will do with the `:2222` should the connection actually succeed).\n\n\nI don't see a simple way to distinguish between \"I want to connect to\nport 22 and access directory 2222/path\" and \"I want to connect to port\n2222 and access directory path\". So Git chose for you the first option\n(if you replace 2222 with abcd, it clearly makes sense).\n\n-- \nMatthieu Moy\nhttps://matthieu-moy.fr/\n"},{"id":"334580","messageId":"000a01d371ff$c2aca590$4805f0b0$@nexbridge.com","threadId":"47420","inReplyTo":"0101016042190a3b-091dfab3-e010-4fbe-94e7-739ae3090883-000000@us-west-2.amazonses.com","subject":"RE: SSH port ignored when ssh:// prefix isn't specified","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2017-12-10T21:42:16Z","receivedAt":"2017-12-10T21:42:32Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On December 10, 2017 3:24 PM Mahmoud wrote:\n\n>It appears that for non-standard ports to be specified for ssh-based\nclones/checkouts, the leading \"ssh://\" prefix must\n>be applied. I am unsure if there's a reason for this or if it is simply an\noverlooked idiosyncrasy in the parser.\n\n>Basically, while `git clone ssh://git@example.com:2222/path` works, the\nsame with the `ssh://` prefix doesn't,\n>and attempts to establish a connection to port 22 instead: `git clone\ngit@example.com:2222/path` (I'm not\n>sure what it will do with the `:2222` should the connection actually\nsucceed).\n\nGit is attempting to resolve the repository \"2222/path\" as it's default\nbehaviour since the ssh method is not specified. This is a situation where\nthe default is ambiguous so while git is choosing the ssh method, it is also\nchoosing repository resolution after the ':' which is also default\nbehaviour.\n\nCheers,\nRandall\n\n-- Brief whoami: NonStop&UNIX developer since approximately\nUNIX(421664400)/NonStop(211288444200000000) \n-- In my real life, I talk too much.\n\n\n\n"}]}