git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH] git_connect: clarify conn->use_shell flag
Date: Tue, 8 Sep 2015 17:40:19 -0400	[thread overview]
Message-ID: <20150908214019.GA24159@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqwpw096dq.fsf@gitster.mtv.corp.google.com>

On Tue, Sep 08, 2015 at 10:18:41AM -0700, Junio C Hamano wrote:

> > To make the flow easier to follow, let's just set
> > conn->use_shell when we're setting up the "conn" struct, and
> > unset it (with a comment) in the historical GIT_SSH case.
> 
> Makes perfect sense.  I think another thing that falls into the same
> class wrt readability is 'putty'; if the code does putty=0 at the
> beginning of "various flavours of SSH", and sets it only when it
> checks with "various flavours of plink" when GIT_SSH_COMMAND is not
> set, the logic would be even clearer, I suspect.

Yeah, I think so.

> > Note that for clarity we leave "use_shell" on in the case
> > that we fall back to our default "ssh" This looks like a
> > behavior change, but in practice run-command.c optimizes
> > shell invocations without metacharacters into a straight
> > execve anyway.
> 
> Hmm, interesting.  I am not sure if that has to be the way, though.
> Wouldn't the resulting code become simpler if you do not do that?

Heh, I originally wrote it that way, and waffled between sending one or
the other.

> That is, is is what I have in mind on top of your patch.  Did I
> break something?
> 
>  connect.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)

I think both changes are correct, and the result looks nice to read.
Feel free to squash them in as you apply.

-Peff

      reply	other threads:[~2015-09-08 21:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-04 10:52 [RFC] a tale of Git 2.5, ssh transport and GIT_* environment variables Giuseppe Bilotta
2015-09-04 12:54 ` Jeff King
2015-09-04 14:02   ` Giuseppe Bilotta
2015-09-04 14:26     ` Jeff King
2015-09-04 18:18   ` Junio C Hamano
2015-09-04 21:10     ` Giuseppe Bilotta
2015-09-04 21:44     ` Jeff King
2015-09-04 22:40       ` [PATCH] git_connect: clear GIT_* environment for ssh Jeff King
2015-09-05 13:50         ` Giuseppe Bilotta
2015-09-08  8:33           ` [PATCH] git_connect: clarify conn->use_shell flag Jeff King
2015-09-08 17:18             ` Junio C Hamano
2015-09-08 21:40               ` Jeff King [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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150908214019.GA24159@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=giuseppe.bilotta@gmail.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).