From: "Torsten Bögershausen" <tboegi@web.de>
To: Jeff King <peff@peff.net>, "Reid Woodbury Jr." <reidw@rawsound.com>
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Torsten Bögershausen" <tboegi@web.de>,
git@vger.kernel.org
Subject: Re: git 2.3.4, ssh: Could not resolve hostname
Date: Fri, 03 Apr 2015 02:02:15 +0200 [thread overview]
Message-ID: <551DD887.2010403@web.de> (raw)
In-Reply-To: <20150402193524.GA21555@peff.net>
On 2015-04-02 21.35, Jeff King wrote:
> On Thu, Apr 02, 2015 at 12:31:14PM -0700, Reid Woodbury Jr. wrote:
>
>> Ah, understand. Here's my project URL for 'remote "origin"' with a
>> more meaningful representation of their internal FQDN:
>>
>> url = ssh://rwoodbury@systemname.groupname.online:/opt/git/inventory.git
>>
>> The "online" is their literal internal TLD.
>
> Thanks. The problem is the extra ":" after "online"; your URL is
> malformed. You can just drop that colon entirely.
>
> I do not think we need to support this syntax going forward (the colon
> is meaningless here, and our documentation is clear that it should go
> with a port number), but on the other hand, it might be nice to be more
> liberal, as we were in v2.3.3 and prior. I'll leave it to Torsten to see
> whether supporting that would hurt some of the other cases, or whether
> it would make the code too awkward.
>
> -Peff
Thanks for digging.
This makes my think that it is
a) non-standard to have the extra colon
b) The error message could be better
c) We don't have a test case
d) This reminds my of an improvement from Linus:
608d48b2207a61528
......
So when somebody passes me a "please pull" request pointing to something
like the following
git://git.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
(note the extraneous colon at the end of the host name), git would happily
try to connect to port 0, which would generally just cause the remote to
not even answer, and the "connect()" will take a long time to time out.
.....
Sorry guys for the regression, the old parser handled the extra colon as "port 0",
the new one looks for the "/" as the end of the hostname (and the beginning of the path)
Either we accept the extra colon as before, or the parser puts out a better error message,
(because the OS doesn't seem to do so):
./git clone git://git.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
Cloning into 'v4l-dvb'...
fatal: unable to connect to git.kernel.org::
git.kernel.org:[0: 62.157.140.133]: errno=Connection refused
git.kernel.org:[1: 80.156.86.78]: errno=Connection refused
(Especially the "::" is a little bit funny: the first ':' is the extra one,
the second one comes from the error message:
"unable to connect to %s:\n%s"
That is not really user-friendly, so I put it onto my TODO-list
It seems as if it comes from the repair of another regression, which re-allows
the usage of IPV6 addresses without []:
./git fetch-pack --diag-url ssh://::1/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
Diag: url=ssh://::1/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
Diag: protocol=ssh
Diag: userandhost=::1
Diag: port=NONE
Diag: path=/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
And this makes sense too:
./git fetch-pack --diag-url ssh://git.kernel.org:1/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
Diag: url=ssh://git.kernel.org:1/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
Diag: protocol=ssh
Diag: userandhost=git.kernel.org
Diag: port=1
Diag: path=/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
But not this one:
./git fetch-pack --diag-url ssh://git.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
Diag: url=ssh://git.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
Diag: protocol=ssh
Diag: userandhost=git.kernel.org:
Diag: port=NONE
Spontaneously I would say that a trailing ':' at the end of a hostname in the ssh:// scheme
can be safely ignored, what do you think ?
next prev parent reply other threads:[~2015-04-03 0:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-02 17:18 git 2.3.4, ssh: Could not resolve hostname Reid Woodbury Jr.
2015-04-02 18:09 ` Jeff King
2015-04-02 18:58 ` Reid Woodbury Jr.
2015-04-02 19:14 ` Jeff King
2015-04-02 19:24 ` Junio C Hamano
2015-04-02 19:31 ` Reid Woodbury Jr.
2015-04-02 19:35 ` Jeff King
2015-04-02 20:06 ` Reid Woodbury Jr.
2015-04-02 20:15 ` Thomas Schneider
2015-04-03 0:02 ` Torsten Bögershausen [this message]
2015-04-03 1:30 ` brian m. carlson
2015-04-03 21:01 ` Junio C Hamano
2015-04-03 21:05 ` Jeff King
2015-04-03 21:32 ` Kyle J. McKay
2015-04-04 0:19 ` Reid Woodbury Jr.
2015-04-04 7:21 ` Torsten Bögershausen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=551DD887.2010403@web.de \
--to=tboegi@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=reidw@rawsound.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).