git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Default ssh command

From
AHAaron Hall <aaronchallmba@gmail.com>
Date
Jul 7, 2021, 02:13 UTC
Message-ID
<CADrEZfEVbtbovTbFM2BEuK_cWp4jcV3CZyrzasvsvFbuu1rmWg@mail.gmail.com>
In-Reply-To
<CADrEZfHJZT47nNZJ8v2T4vOJkMN7ccaai6DKdzFLF8Zoc42hWw@mail.gmail.com>
Show 5 quoted lines
> When we use ssh to run the receive-pack over the wire while pushing,
> we do not ask for pty, and because the "-e" option to set the escape
> character is meaningful only when ssh runs with pty allocated, you
> shouldn't have to do this, unless you force pty allocation by
> e.g. passing "-t" yourself.
Then I wonder why I'm getting a pseudoterminal.

Note that I'm using git from git bash on Windows in a walled off corporate environment.

The ssh manpage says:
> If no pseudo-terminal has been allocated, the session is transparent
> and can be used to reliably transfer binary data.  On most
> systems, setting the escape character to ``none'' will also
> make the session transparent even if a tty is used.

If we want the ssh to be binary transparent regardless (and I think we do) then that makes my suggestion, `ssh -e none`, still perhaps a good one?

On Tue, Jul 6, 2021 at 10:03 PM Aaron Hall <aaronchallmba@gmail.com> wrote:
Show 37 quoted lines
>
> I'll reply on list.
>
> On Tue, Jul 6, 2021 at 9:58 PM Aaron Hall <aaronchallmba@gmail.com> wrote:
> >
> > My context is using git from git bash on Windows in a walled off environment.
> >
> > On Tue, Jul 6, 2021 at 9:48 PM Junio C Hamano <gitster@pobox.com> wrote:
> > >
> > > Aaron Hall <aaronchallmba@gmail.com> writes:
> > >
> > > > I was trying to push some binary files (PNGs) over ssh and found some
> > > > files inexplicably wouldn't successfully push.
> > > >
> > > > I set, in my .gitconfig file:
> > > >
> > > > [core]
> > > >         sshCommand = ssh -e none
> > > >
> > > > And it works now for all files (that I can tell).
> > > >
> > > > From a close examination of the output where I noted escape codes
> > > > showing up, I believe the problem to be ssh escape codes.
> > > >
> > > > `\n~.` for example closes the ssh client.
> > > >
> > > > Therefore I think the default ssh command should be `ssh -e none`
> > > > instead of `ssh` for the benefit of users who won't recognize the
> > > > problem, unless `git` is expected to make use of ssh escape codes.
> > >
> > > Curious.
> > >
> > > When we use ssh to run the receive-pack over the wire while pushing,
> > > we do not ask for pty, and because the "-e" option to set the escape
> > > character is meaningful only when ssh runs with pty allocated, you
> > > shouldn't have to do this, unless you force pty allocation by
> > > e.g. passing "-t" yourself.
Previous: Junio C HamanoNext: brian m. carlson
Message 3 of 5 in “Default ssh command”
  1. Aaron HallJul 7, 2021
  2. Junio C HamanoJul 7, 2021
  3. Aaron HallJul 7, 2021
  4. brian m. carlsonJul 7, 2021
  5. Aaron HallJul 8, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.