RE: SSH port ignored when ssh:// prefix isn't specified

2017-12-10 Thread Randall S. Becker
On December 10, 2017 3:24 PM Mahmoud wrote:

>It appears that for non-standard ports to be specified for ssh-based
clones/checkouts, the leading "ssh://" prefix must
>be applied. I am unsure if there's a reason for this or if it is simply an
overlooked idiosyncrasy in the parser.

>Basically, while `git clone ssh://g...@example.com:/path` works, the
same with the `ssh://` prefix doesn't,
>and attempts to establish a connection to port 22 instead: `git clone
g...@example.com:/path` (I'm not
>sure what it will do with the `:` should the connection actually
succeed).

Git is attempting to resolve the repository "/path" as it's default
behaviour since the ssh method is not specified. This is a situation where
the default is ambiguous so while git is choosing the ssh method, it is also
choosing repository resolution after the ':' which is also default
behaviour.

Cheers,
Randall

-- Brief whoami: NonStop developer since approximately
UNIX(421664400)/NonStop(2112884442) 
-- In my real life, I talk too much.





Re: SSH port ignored when ssh:// prefix isn't specified

2017-12-10 Thread Matthieu Moy
"mqu...@neosmart.net"  writes:

> Basically, while `git clone ssh://g...@example.com:/path` works, the same
> with the `ssh://` prefix doesn't, and attempts to establish a connection to
> port 22 instead: `git clone g...@example.com:/path` (I'm not sure what it
> will do with the `:` should the connection actually succeed).


I don't see a simple way to distinguish between "I want to connect to
port 22 and access directory /path" and "I want to connect to port
 and access directory path". So Git chose for you the first option
(if you replace  with abcd, it clearly makes sense).

-- 
Matthieu Moy
https://matthieu-moy.fr/