Merge branch 'sf/putty-w-args'
authorJunio C Hamano <gitster@pobox.com>
Mon, 27 Feb 2017 21:57:14 +0000 (13:57 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Feb 2017 21:57:15 +0000 (13:57 -0800)
The command line options for ssh invocation needs to be tweaked for
some implementations of SSH (e.g. PuTTY plink wants "-P <port>"
while OpenSSH wants "-p <port>" to specify port to connect to), and
the variant was guessed when GIT_SSH environment variable is used
to specify it. The logic to guess now applies to the command
specified by the newer GIT_SSH_COMMAND and also core.sshcommand
configuration variable, and comes with an escape hatch for users to
deal with misdetected cases.

* sf/putty-w-args:
connect.c: stop conflating ssh command names and overrides
connect: Add the envvar GIT_SSH_VARIANT and ssh.variant config
git_connect(): factor out SSH variant handling
connect: rename tortoiseplink and putty variables
connect: handle putty/plink also in GIT_SSH_COMMAND

1  2 
Documentation/config.txt
Documentation/git.txt
diff --combined Documentation/config.txt
index 10351a21000ed6e6dfe7eb05bdad53b9b9fba3e5,b88df57ab6adc4b7af5c1b0ec43262d1ab393768..9dbd96dbba4e773d7dfd910857ab5d69760a03a0
@@@ -170,9 -170,6 +170,9 @@@ The position of any attributes with res
  be turned off by prefixing them with `no` or `no-` (e.g., `noreverse`,
  `no-ul`, etc).
  +
 +An empty color string produces no color effect at all. This can be used
 +to avoid coloring specific elements without disabling color entirely.
 ++
  For git's pre-defined color slots, the attributes are meant to be reset
  at the beginning of each item in the colored output. So setting
  `color.decorate.branch` to `black` will paint that branch name in a
@@@ -520,12 -517,10 +520,12 @@@ core.logAllRefUpdates:
        "`$GIT_DIR/logs/<ref>`", by appending the new and old
        SHA-1, the date/time and the reason of the update, but
        only when the file exists.  If this configuration
 -      variable is set to true, missing "`$GIT_DIR/logs/<ref>`"
 +      variable is set to `true`, missing "`$GIT_DIR/logs/<ref>`"
        file is automatically created for branch heads (i.e. under
 -      refs/heads/), remote refs (i.e. under refs/remotes/),
 -      note refs (i.e. under refs/notes/), and the symbolic ref HEAD.
 +      `refs/heads/`), remote refs (i.e. under `refs/remotes/`),
 +      note refs (i.e. under `refs/notes/`), and the symbolic ref `HEAD`.
 +      If it is set to `always`, then a missing reflog is automatically
 +      created for any ref under `refs/`.
  +
  This information can be used to determine what commit
  was the tip of a branch "2 days ago".
@@@ -1919,10 -1914,7 +1919,10 @@@ http.<url>.*:
    must match exactly between the config key and the URL.
  
  . Host/domain name (e.g., `example.com` in `https://example.com/`).
 -  This field must match exactly between the config key and the URL.
 +  This field must match between the config key and the URL. It is
 +  possible to specify a `*` as part of the host name to match all subdomains
 +  at this level. `https://*.example.com/` for example would match
 +  `https://foo.example.com/`, but not `https://foo.bar.example.com/`.
  
  . Port number (e.g., `8080` in `http://example.com:8080/`).
    This field must match exactly between the config key and the URL.
@@@ -1957,6 -1949,17 +1957,17 @@@ Environment variable settings always ov
  matched against are those given directly to Git commands.  This means any URLs
  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 plink or tortoiseplink, as opposed to the default (OpenSSH).
+ +
+ The config variable `ssh.variant` can be set to override this auto-detection;
+ valid values are `ssh`, `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`.
  i18n.commitEncoding::
        Character encoding the commit messages are stored in; Git itself
        does not care per se, but this information is necessary e.g. when
@@@ -2044,10 -2047,6 +2055,10 @@@ log.follow:
        i.e. it cannot be used to follow multiple files and does not work well
        on non-linear history.
  
 +log.graphColors::
 +      A list of colors, separated by commas, that can be used to draw
 +      history lines in `git log --graph`.
 +
  log.showRoot::
        If true, the initial commit will be shown as a big creation event.
        This is equivalent to a diff against an empty tree.
@@@ -2952,7 -2951,7 +2963,7 @@@ submodule.alternateLocation:
        value is set to `superproject` the submodule to be cloned computes
        its alternates location relative to the superprojects alternate.
  
 -submodule.alternateErrorStrategy
 +submodule.alternateErrorStrategy::
        Specifies how to treat errors with the alternates for a submodule
        as computed via `submodule.alternateLocation`. Possible values are
        `ignore`, `info`, `die`. Default is `die`.
diff --combined Documentation/git.txt
index aa895da4a5fbc5e83c87bfa98683157d3d43fa0e,a0c6728d1af307dda73ad9eaa01f6970b32529dc..df0941d456b0fa1ab3be4f459f73edd3145ffb32
@@@ -44,11 -44,6 +44,11 @@@ unreleased) version of Git, that is ava
  branch of the `git.git` repository.
  Documentation for older releases are available here:
  
 +* link:v2.12.0/git.html[documentation for release 2.12.0]
 +
 +* release notes for
 +  link:RelNotes/2.12.0.txt[2.12].
 +
  * link:v2.11.1/git.html[documentation for release 2.11.1]
  
  * release notes for
@@@ -1025,6 -1020,12 +1025,12 @@@ Usually it is easier to configure any d
  personal `.ssh/config` file.  Please consult your ssh documentation
  for further details.
  
+ `GIT_SSH_VARIANT`::
+       If this environment variable is set, it overrides Git's autodetection
+       whether `GIT_SSH`/`GIT_SSH_COMMAND`/`core.sshCommand` refer to OpenSSH,
+       plink or tortoiseplink. This variable overrides the config setting
+       `ssh.variant` that serves the same purpose.
  `GIT_ASKPASS`::
        If this environment variable is set, then Git commands which need to
        acquire passwords or passphrases (e.g. for HTTP or IMAP authentication)