git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* SSH port ignored when ssh:// prefix isn't specified
@ 2017-12-10 20:23 mqudsi
  2017-12-10 20:31 ` Matthieu Moy
  2017-12-10 21:42 ` Randall S. Becker
  0 siblings, 2 replies; 3+ messages in thread
From: mqudsi @ 2017-12-10 20:23 UTC (permalink / raw)
  To: git@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 584 bytes --]

Greetings,

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://git@example.com:2222/path` works, the same
with the `ssh://` prefix doesn't, and attempts to establish a connection to
port 22 instead: `git clone git@example.com:2222/path` (I'm not sure what it
will do with the `:2222` should the connection actually succeed).

Mahmoud Al-Qudsi
NeoSmart Technologies


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

* Re: SSH port ignored when ssh:// prefix isn't specified
  2017-12-10 20:23 SSH port ignored when ssh:// prefix isn't specified mqudsi
@ 2017-12-10 20:31 ` Matthieu Moy
  2017-12-10 21:42 ` Randall S. Becker
  1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Moy @ 2017-12-10 20:31 UTC (permalink / raw)
  To: mqudsi@neosmart.net; +Cc: git@vger.kernel.org

"mqudsi@neosmart.net" <mqudsi@neosmart.net> writes:

> Basically, while `git clone ssh://git@example.com:2222/path` works, the same
> with the `ssh://` prefix doesn't, and attempts to establish a connection to
> port 22 instead: `git clone git@example.com:2222/path` (I'm not sure what it
> will do with the `:2222` 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 2222/path" and "I want to connect to port
2222 and access directory path". So Git chose for you the first option
(if you replace 2222 with abcd, it clearly makes sense).

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

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

* RE: SSH port ignored when ssh:// prefix isn't specified
  2017-12-10 20:23 SSH port ignored when ssh:// prefix isn't specified mqudsi
  2017-12-10 20:31 ` Matthieu Moy
@ 2017-12-10 21:42 ` Randall S. Becker
  1 sibling, 0 replies; 3+ messages in thread
From: Randall S. Becker @ 2017-12-10 21:42 UTC (permalink / raw)
  To: mqudsi, git

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://git@example.com:2222/path` works, the
same with the `ssh://` prefix doesn't,
>and attempts to establish a connection to port 22 instead: `git clone
git@example.com:2222/path` (I'm not
>sure what it will do with the `:2222` should the connection actually
succeed).

Git is attempting to resolve the repository "2222/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&UNIX developer since approximately
UNIX(421664400)/NonStop(211288444200000000) 
-- In my real life, I talk too much.




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

end of thread, other threads:[~2017-12-10 21:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-10 20:23 SSH port ignored when ssh:// prefix isn't specified mqudsi
2017-12-10 20:31 ` Matthieu Moy
2017-12-10 21:42 ` Randall S. Becker

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).