git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Fredrik Tolf <fredrik@dolda2000.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Jeff King <peff@peff.net>, Jakub Narebski <jnareb@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH v2] Ensure that SSH runs in non-interactive mode
Date: Mon, 21 Jul 2008 15:04:09 +0200	[thread overview]
Message-ID: <1216645452.3673.29.camel@pc7.dolda2000.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0807211221310.8986@racer>

On Mon, 2008-07-21 at 12:22 +0100, Johannes Schindelin wrote:
> Hi,
> 
> On Mon, 21 Jul 2008, Jeff King wrote:
> 
> > On Mon, Jul 21, 2008 at 12:56:14PM +0200, Johannes Schindelin wrote:
> > 
> > > > or syntax used in RPM spec macros
> > > > 
> > > >   %{?p:-P %p}
> > > > 
> > > > (and there is complementing %{!?<var>:<expansion>} in RPM spec macro
> > > > language).
> > > 
> > > Yes, this is overkill.  I would even have passed the port argument 
> > > _always_, since the port 22 for ssh is as likely to change as hell will 
> > > not freeze over.  Actually, I am not so sure about the latter.
> > 
> > But keep in mind that "-p 22" on the command line _overrides_ what the
> > user has in their ssh config, so it is not a good idea to pass it all
> > the time.
> 
> Oh, good point.  So we might need something distasteful as what Jakub 
> proposed... Hrmpf.

Two suggestions:

 * Use %P as I suggested. I know it is kind of ugly, but I might still
   consider it less ugly than adding full shell-style substitution to
   the code. Especially considering that it would almost only have to be
   used inside of Git. Users outside of the Git source would only very
   seldomly have to touch it. (It would essentially only be those users
   who both use alternative SSH ports *and* has an non-standard default
   in their ssh_config *and* use a custom SSH command...)
 * Put the SSH port number and host name in the environment and call
   "/bin/sh -c" with the textual concatenation of the SSH command and
   the command that Git wants to call. While a bit more ugly than
   handling word splitting internally, I don't really think that it has
   any real ill effects, seeing how the Git command is word-split on the
   remote side anyhow (I think that has to be SSH's most stupid
   "feature").

Fredrik Tolf

      reply	other threads:[~2008-07-21 13:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21  0:00 [PATCH v2] Ensure that SSH runs in non-interactive mode Fredrik Tolf
2008-07-21  1:15 ` Johannes Schindelin
2008-07-21  1:44   ` Fredrik Tolf
2008-07-21  8:38     ` Jakub Narebski
2008-07-21 10:56       ` Johannes Schindelin
2008-07-21 11:04         ` Jeff King
2008-07-21 11:22           ` Johannes Schindelin
2008-07-21 13:04             ` Fredrik Tolf [this message]

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=1216645452.3673.29.camel@pc7.dolda2000.com \
    --to=fredrik@dolda2000.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=peff@peff.net \
    /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).