git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Matthias Aßhauer" <mha1993@live.de>
Cc: "Raymond E. Pasco" <ray@ameretat.dev>,
	git@vger.kernel.org, Jonathan Nieder <jrnieder@gmail.com>,
	Stefan Beller <sbeller@google.com>
Subject: Re: [PATCH v2] ssh: add 'ssh.keyfile' option
Date: Thu, 23 Apr 2020 12:38:21 -0700	[thread overview]
Message-ID: <xmqqeesegfgy.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <AM0PR04MB47715A57B110E14D6631EACDA5D30@AM0PR04MB4771.eurprd04.prod.outlook.com> ("Matthias =?utf-8?Q?A=C3=9Fhauer=22's?= message of "Thu, 23 Apr 2020 20:03:26 +0200")

Matthias Aßhauer <mha1993@live.de> writes:

>>+		switch (variant) {
>>+		case VARIANT_AUTO:
>>+			BUG("VARIANT_AUTO passed to push_ssh_options");
>
> Why do we keep replicating this all over push_ssh_options? The wording
> very much sounds like it's a bug whenever VARIANT_AUTO gets passed to
> push_ssh_options, no exceptions. In that case ...

My reading of the code tells me that it is *not* the case.  When the
caller asks to connect only over IPv4 with CONNECT_IPV4 bit set in
the flags, we cannot translate that to an option to underlying SSH
implementation without knowing the variant.  As long as the caller
does not specify IPV4/IPV6 or custom port, I think it is OK for the
caller to leave the variant AUTO.

So you probably want a patch along the lines of...

 connect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/connect.c b/connect.c
index b6451ab5e8..b02cf74c9a 100644
--- a/connect.c
+++ b/connect.c
@@ -1118,7 +1118,7 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,
 	if (flags & CONNECT_IPV4) {
 		switch (variant) {
 		case VARIANT_AUTO:
-			BUG("VARIANT_AUTO passed to push_ssh_options");
+			BUG("VARIANT_AUTO and CONNECT_IPV4 used together");
 		case VARIANT_SIMPLE:
 			die(_("ssh variant 'simple' does not support -4"));
 		case VARIANT_SSH:

  reply	other threads:[~2020-04-23 19:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23  6:41 [PATCH] ssh: add 'ssh.keyfile' option Raymond E. Pasco
2020-04-23 11:21 ` [PATCH v2] " Raymond E. Pasco
2020-04-23 17:24   ` Johannes Sixt
2020-04-23 19:32     ` Junio C Hamano
2020-04-24  3:24     ` Raymond E. Pasco
2020-04-23 18:03   ` Matthias Aßhauer
2020-04-23 19:38     ` Junio C Hamano [this message]
2020-04-24  4:33       ` Matthias Aßhauer
2020-04-25  9:43         ` [PATCH] connect.c: clarify BUG() messages in push_ssh_options Matthias Aßhauer

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=xmqqeesegfgy.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=mha1993@live.de \
    --cc=ray@ameretat.dev \
    --cc=sbeller@google.com \
    /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).