On Mon, 23 Oct 2017 14:31:59 -0700 Jonathan Nieder <jrnieder@xxxxxxxxx> wrote: > @@ -2083,14 +2083,19 @@ visited as a result of a redirection do not participate in matching. > ssh.variant:: > Depending on the value of the environment variables `GIT_SSH` or > `GIT_SSH_COMMAND`, or the config setting `core.sshCommand`, Git > - auto-detects whether to adjust its command-line parameters for use > - with ssh (OpenSSH), plink or tortoiseplink, as opposed to the default > - (simple). > + auto-detects whether to pass command-line parameters for use > + with a simple wrapper script (simple), OpenSSH (ssh), plink, or > + tortoiseplink. > ++ > +The default is `auto`, which means to auto-detect whether the ssh command > +implements OpenSSH options using the `-G` (print configuration) option. > +If the ssh command supports OpenSSH options, it then behaves like `ssh`; > +otherwise, it behaves like `simple`. > + > The config variable `ssh.variant` can be set to override this auto-detection; > -valid values are `ssh`, `simple`, `plink`, `putty` or `tortoiseplink`. Any > -other value will be treated as normal ssh. This setting can be overridden via > -the environment variable `GIT_SSH_VARIANT`. > +valid values are `ssh`, `simple`, `plink`, `putty`, `tortoiseplink`, and > +`auto`. Any other value will be treated as normal ssh. This setting can be > +overridden via the environment variable `GIT_SSH_VARIANT`. The new documentation seems to imply that setting ssh.variant (or GIT_SSH_VARIANT) to "auto" is equivalent to not setting it at all, but looking at the code, it doesn't seem to be the case (not setting it at all invokes checking the first word of core.sshCommand, and only uses VARIANT_AUTO if that check is inconclusive, whereas setting ssh.variant=auto skips the core.sshCommand check entirely). Maybe document ssh.variant as follows: If unset, Git will determine the command-line arguments to use based on the basename of the configured SSH command (through the environment variable `GIT_SSH` or `GIT_SSH_COMMAND`, or the config setting `core.sshCommand`). If the basename is unrecognized, Git will attempt to detect support of OpenSSH options by first invoking the configured SSH command with the `-G` (print configuration) flag, and will subsequently use OpenSSH options (upon success) or no options besides the host (upon failure). If set, Git will not do any auto-detection based on the basename of the configured SSH command. This can be set to `ssh` (OpenSSH options), `plink`, `putty`, `tortoiseplink`, `simple` (no options besides the host), or `auto` (the detection with `-G` as described above). If set to any other value, Git behaves as if this is set to `ssh`. (Patches 1, 2, 4, and 5 seem fine to me.)