Skip to content

Commit ef47036

Browse files
committed
Merge branch 'jn/ssh-wrappers'
The ssh-variant 'simple' introduced earlier broke existing installations by not passing --port/-4/-6 and not diagnosing an attempt to pass these as an error. Instead, default to automatically detect how compatible the GIT_SSH/GIT_SSH_COMMAND is to OpenSSH convention and then error out an invocation to make it easier to diagnose connection errors. * jn/ssh-wrappers: connect: correct style of C-style comment ssh: 'simple' variant does not support --port ssh: 'simple' variant does not support -4/-6 ssh: 'auto' variant to select between 'ssh' and 'simple' connect: split ssh option computation to its own function connect: split ssh command line options into separate function connect: split git:// setup into a separate function connect: move no_fork fallback to git_tcp_connect ssh test: make copy_ssh_wrapper_as clean up after itself
2 parents 4c6dad0 + 233cd28 commit ef47036

File tree

4 files changed

+266
-152
lines changed

4 files changed

+266
-152
lines changed

Documentation/config.txt

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,16 +2108,22 @@ matched against are those given directly to Git commands. This means any URLs
21082108
visited as a result of a redirection do not participate in matching.
21092109

21102110
ssh.variant::
2111-
Depending on the value of the environment variables `GIT_SSH` or
2112-
`GIT_SSH_COMMAND`, or the config setting `core.sshCommand`, Git
2113-
auto-detects whether to adjust its command-line parameters for use
2114-
with ssh (OpenSSH), plink or tortoiseplink, as opposed to the default
2115-
(simple).
2116-
+
2117-
The config variable `ssh.variant` can be set to override this auto-detection;
2118-
valid values are `ssh`, `simple`, `plink`, `putty` or `tortoiseplink`. Any
2119-
other value will be treated as normal ssh. This setting can be overridden via
2120-
the environment variable `GIT_SSH_VARIANT`.
2111+
By default, Git determines the command line arguments to use
2112+
based on the basename of the configured SSH command (configured
2113+
using the environment variable `GIT_SSH` or `GIT_SSH_COMMAND` or
2114+
the config setting `core.sshCommand`). If the basename is
2115+
unrecognized, Git will attempt to detect support of OpenSSH
2116+
options by first invoking the configured SSH command with the
2117+
`-G` (print configuration) option and will subsequently use
2118+
OpenSSH options (if that is successful) or no options besides
2119+
the host and remote command (if it fails).
2120+
+
2121+
The config variable `ssh.variant` can be set to override this detection.
2122+
Valid values are `ssh` (to use OpenSSH options), `plink`, `putty`,
2123+
`tortoiseplink`, `simple` (no options except the host and remote command).
2124+
The default auto-detection can be explicitly requested using the value
2125+
`auto`. Any other value is treated as `ssh`. This setting can also be
2126+
overridden via the environment variable `GIT_SSH_VARIANT`.
21212127
+
21222128
The current command-line parameters used for each variant are as
21232129
follows:

0 commit comments

Comments
 (0)