git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Joel Holdsworth <jholdsworth@nvidia.com>
Cc: Git List <git@vger.kernel.org>, Luke Diamand <luke@diamand.org>,
	Junio C Hamano <gitster@pobox.com>,
	Tzadik Vanderhoof <tzadik.vanderhoof@gmail.com>,
	Dorgon Chang <dorgonman@hotmail.com>,
	Joachim Kuebart <joachim.kuebart@gmail.com>,
	Daniel Levin <dendy.ua@gmail.com>,
	Johannes Schindelin <johannes.schindelin@gmx.de>,
	Ben Keene <seraphire@gmail.com>,
	Andrew Oakley <andrew@adoakley.name>
Subject: Re: [PATCH 1/3] git-p4: don't select shell mode using the type of the command argument
Date: Thu, 6 Jan 2022 12:02:49 -0500	[thread overview]
Message-ID: <CAPig+cTN933GO42m10qbABz8gX61d2uKDJWQmYHYCCar5rgFSA@mail.gmail.com> (raw)
In-Reply-To: <20220105161451.56378-2-jholdsworth@nvidia.com>

On Thu, Jan 6, 2022 at 7:43 AM Joel Holdsworth <jholdsworth@nvidia.com> wrote:
> Previously, the script would invoke subprocess functions setting the
> shell argument True if the command argument was a string, setting it
> False otherwise.
>
> This patch replaces this implicit type-driven behaviour with explicit
> shell arguments specified by the caller.
>
> The apparent motive for the implict behaviour is that the subprocess
> functions do not divide command strings into args. Invoking
> subprocess.call("echo hello") will attempt to execute a program by the
> name "echo hello". With subprocess.call("echo hello", shell=True), sh
> -c "echo hello" will be executed instead, which will cause the command
> and args to be divided by spaces.
>
> Eventually, all usage of shell=True, that is not necessary for some
> purpose beyond parsing command strings, should be removed. For now,
> this patch makes the usage of shells explicit.
> ---

Missing sign-off.

  reply	other threads:[~2022-01-06 17:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 16:14 [PATCH 0/3] git-p4: Rationalise command construction Joel Holdsworth
2022-01-05 16:14 ` [PATCH 1/3] git-p4: don't select shell mode using the type of the command argument Joel Holdsworth
2022-01-06 17:02   ` Eric Sunshine [this message]
2022-01-05 16:14 ` [PATCH 2/3] git-p4: pass command arguments as lists instead of using shell Joel Holdsworth
2022-01-05 16:14 ` [PATCH 3/3] git-p4: don't print shell commands as python lists Joel Holdsworth
2022-01-06 17:09   ` Eric Sunshine

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=CAPig+cTN933GO42m10qbABz8gX61d2uKDJWQmYHYCCar5rgFSA@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=andrew@adoakley.name \
    --cc=dendy.ua@gmail.com \
    --cc=dorgonman@hotmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jholdsworth@nvidia.com \
    --cc=joachim.kuebart@gmail.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=luke@diamand.org \
    --cc=seraphire@gmail.com \
    --cc=tzadik.vanderhoof@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).