Subject: Re: [PATCH 3/5] ssh: 'auto' variant to select between 'ssh' and 'simple'

From: Junio C Hamano <[email-masked]>
Date: Tue, 24 Oct 2017 11:16:33 +0900

Jonathan Nieder <[email-masked]> writes:

>  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.