Re: [PATCH 3/5] ssh: 'auto' variant to select between 'ssh' and 'simple'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 24, 2017, 02:16 UTC
- Message-ID
- <xmqq60b59toe.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20171023213159.eitrjrqrh277advm@aiede.mtv.corp.google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 15 quoted lines
> 1. First, check whether $GIT_SSH supports OpenSSH options by running > > $GIT_SSH -G <options> <host> > > This returns status 0 and prints configuration in OpenSSH if it > recognizes all <options> and returns status 255 if it encounters > an unrecognized option. A wrapper script like > > exec ssh -- "$@" > > would fail with > > ssh: Could not resolve hostname -g: Name or service not known > > , correctly reflecting that it does not support OpenSSH options.
Two comments.
* It would have been really nicer if the push_ssh_options() got split from its caller in a separate preparatory [PATCH 2.5/5].
* Use of -G for auto-detection is clever and cute, but do we know how safe it would be in the real world? What worries me the most is "myssh -G localhost" (no extra options) that does not fit our expectation on "-G" to either exit immediately with an error when it is not understood, or to exit like OpenSSH does, and instead successfully makes a connection and gets stuck.