From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: "'Junio C Hamano'" <gitster@pobox.com>
Cc: "'Git Mailing List'" <git@vger.kernel.org>
Subject: RE: [Patch 1/3] connect.c: add nonstopssh variant to the sshVariant set.
Date: Fri, 4 Jun 2021 16:35:25 -0400 [thread overview]
Message-ID: <00f801d75981$29225c90$7b6715b0$@nexbridge.com> (raw)
In-Reply-To: <xmqqo8cl1k8s.fsf@gitster.g>
On June 4, 2021 3:52 PM, Junio C Hamano wrote:
>"Randall S. Becker" <rsbecker@nexbridge.com> writes:
>> The primary
>> problem is supplying -S $ZSSH0 on the command line causes $ZSSH0 to be
>> resolved as a shell variable. It is not.
>
>I think we've heard that one before, and the whole thing sounds like you are saying that a command line
>
> $ cmd $ZSSH0
>
>expects ZSSH0 to be a variable and tries to interpolate its value before passing it to "cmd" while you want "cmd" to see a literal
string that
>begins with a dollar sign.
>
>And the standard solution to that problem obviously is to tell the shell that the dollar-sign is not a reference to a variable by
quoting, by
>using any variant of e.g.
>
> $ cmd \$ZSSH0
> $ cmd '$ZSSH0'
> $ cmd "\$ZSSH0"
I'm going to have to retest this, but, when I last tried this, admittedly around git 2.0, what happened was that one level of
escaping the $ worked for ls-remote, but we needed two levels for upload-pack which seemed to have two shells processing the
command. I might be wrong about the specifics (been 4 years), but there was an inconsistency with the number of required escapes.
The single quote did not work for upload-pack at the time. It is entirely possible that the second level indirection happened
because the execution of the sshoss command itself cross over a platform boundary between the POSIX and non-POSIX file systems (it
lives in the non-POSIX side).
>As far as I can tell, the code in connect.c that spawns ssh via GIT_SSH_COMMAND uses the pretty vanilla run_command() interface,
and
>that ought to be capable of producing such a command line, so I am lost as to where the need to have special case comes from.
>"cmd" here may be "ssh" but run_command() should not care what exact command is being invoked. I am puzzled why a simple quoting
>like the following cannot be adjusted for this particular case, for
>example:
>
> $ cat >>.git/config <<\EOF
> [alias]
> cmdtest0 = "!echo ..\\$ZSSH0.."
> cmdtest1 = "!echo ..$ZSSH0.."
> EOF
> $ ZSSH0=foo git cmdtest0
> ..$ZSSH0..
> $ ZSSH0=foo git cmdtest1
> ..foo..
The multi-level resolution that I experienced is not covered in this situation. Still going to investigate this. I'm working on a
different approach to extend my wrapper script to parse out the port, to supply to sshoss, which is not complaint with the standard
ssh. If I have to stick with that script, there's no point going further on this variant.
next prev parent reply other threads:[~2021-06-04 20:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 14:55 [Patch 1/3] connect.c: add nonstopssh variant to the sshVariant set Randall S. Becker
2021-04-30 16:25 ` Elijah Newren
2021-04-30 16:38 ` Randall S. Becker
2021-04-30 17:17 ` Elijah Newren
2021-04-30 17:32 ` Randall S. Becker
2021-05-10 15:24 ` Randall S. Becker
2021-06-04 19:29 ` Randall S. Becker
2021-06-04 19:51 ` Junio C Hamano
2021-06-04 20:35 ` Randall S. Becker [this message]
2021-06-05 21:56 ` Randall S. Becker
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='00f801d75981$29225c90$7b6715b0$@nexbridge.com' \
--to=rsbecker@nexbridge.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).