From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Fredrik Tolf <fredrik@dolda2000.com>,
Keith Packard <keithp@keithp.com>,
git@vger.kernel.org,
"Edward Z. Yang" <edwardzyang@thewritingpot.com>,
Steffen Prohaska <prohaska@zib.de>
Subject: Re: [PATCH] Ensure that SSH runs in non-interactive mode
Date: Sun, 20 Jul 2008 12:51:44 -0700 [thread overview]
Message-ID: <7vhcak5o6n.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.DEB.1.00.0807202035090.3305@eeepc-johanness> (Johannes Schindelin's message of "Sun, 20 Jul 2008 20:57:48 +0200 (CEST)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> How about this instead?
>
> -- snipsnap --
> diff --git a/connect.c b/connect.c
> index 574f42f..7e7f4d3 100644
> --- a/connect.c
> +++ b/connect.c
> @@ -603,7 +603,8 @@ struct child_process *git_connect(int fd[2], const char *url
>
> *arg++ = ssh;
> if (port) {
> - *arg++ = "-p";
> + const char *opt = getenv("GIT_SSH_PORT_OPTION");
> + *arg++ = opt ? opt : "-p";
> *arg++ = port;
> }
> *arg++ = host;
If you only care only about the ones we currently want to support, I do
not htink it makes any difference either way, but if we are shooting for
having a minimum-but-reasonable framework to make it easy to support other
ones that we haven't seen, it feels very much like an inadequate hack to
waste an envirnoment variable for such a narrow special case. With this,
what you really mean is "Plink uses -P instead of -p", right?
I do not know if "plink" is used widely enough to be special cased, but if
so, I think we would better have an explicit support for it. Will we add
GIT_SSH_FORBID_X11_FORWARDING_OPTION environment variable and friends,
too?
The extra environment would not help dealing with an implementation that
wants --port=90222 (i.e. not as two separate arguments but a single one),
for example. You would need the extra wrapper support for that kind of
thing anyway. That extra environment _solution_ will need to make an
assuption that any reasonable implementation would have an option string
to specify port which may not be "-p" and that is to be followed by a
separate argument that is a decimal port number, which probably is
reasonable for this particular "port" thing, but as a general design
principle I do not think it is a good direction to go.
next prev parent reply other threads:[~2008-07-20 19:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-19 17:06 [PATCH] Ensure that SSH runs in non-interactive mode Fredrik Tolf
2008-07-19 17:52 ` Mike Hommey
2008-07-19 17:57 ` Keith Packard
2008-07-19 18:18 ` Fredrik Tolf
2008-07-20 10:27 ` Johannes Schindelin
2008-07-20 17:49 ` Fredrik Tolf
2008-07-20 18:33 ` Johannes Schindelin
2008-07-20 18:42 ` Fredrik Tolf
2008-07-20 18:23 ` Junio C Hamano
2008-07-20 18:57 ` Johannes Schindelin
2008-07-20 19:51 ` Junio C Hamano [this message]
2008-07-20 22:17 ` Johannes Schindelin
2008-07-21 5:07 ` Steffen Prohaska
2008-07-21 0:14 ` Jeff King
2008-07-21 6:53 ` Mike Hommey
2008-07-21 7:05 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vhcak5o6n.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=edwardzyang@thewritingpot.com \
--cc=fredrik@dolda2000.com \
--cc=git@vger.kernel.org \
--cc=keithp@keithp.com \
--cc=prohaska@zib.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).