]> git.ipfire.org Git - thirdparty/git.git/commit - connect.c
connect.c: stop conflating ssh command names and overrides
authorJunio C Hamano <gitster@pobox.com>
Thu, 9 Feb 2017 17:20:25 +0000 (09:20 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Feb 2017 21:47:24 +0000 (13:47 -0800)
commit486c8e8c6a42a1e0537eedb2b5ab9e74eb58d5f7
tree99362f27658fccfc278ecec0ff2e02c8ee98a810
parentdd33e07766f883c1bbfd20482123e143028f0af6
connect.c: stop conflating ssh command names and overrides

dd33e07766 ("connect: Add the envvar GIT_SSH_VARIANT and ssh.variant
config", 2017-02-01) attempted to add support for configuration and
environment variable to override the different handling of
port_option and needs_batch settings suitable for variants of the
ssh implementation that was autodetected by looking at the ssh
command name.  Because it piggybacked on the code that turns command
name to specific override (e.g. "plink.exe" and "plink" means
port_option needs to be set to 'P' instead of the default 'p'), yet
it defined a separate namespace for these overrides (e.g. "putty"
can be usable to signal that port_option needs to be 'P'), however,
it made the auto-detection based on the command name less robust
(e.g. the code now accepts "putty" as a SSH command name and applies
the same override).

Separate the code that interprets the override that was read from
the configuration & environment from the original code that handles
the command names, as they are in separate namespaces, to fix this
confusion.

This incidentally also makes it easier for future enhancement of the
override syntax (e.g. "port_option=p,needs_batch=1" may want to be
accepted as a more explicit syntax) without affecting the code for
auto-detection based on the command name.

While at it, update the return type of the handle_ssh_variant()
helper function to void; the caller does not use it, and the
function does not return any meaningful value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
connect.c