git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Fredrik Medley <fredrik.medley@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] rebase-i-exec: Allow space in SHELL_PATH
Date: Fri, 13 Nov 2015 01:25:35 -0500	[thread overview]
Message-ID: <20151113062534.GE32157@sigill.intra.peff.net> (raw)
In-Reply-To: <1447394599-16077-1-git-send-email-fredrik.medley@gmail.com>

On Fri, Nov 13, 2015 at 07:03:19AM +0100, Fredrik Medley wrote:

> On Windows, when Git is installed under "C:\Program Files\Git", SHELL_PATH
> will include a space. Fix "git rebase --interactive --exec" so that it
> works with spaces in SHELL_PATH.
> 
> Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
> ---
>  git-rebase--interactive.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index 30edb17..b938a6d 100644
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -610,7 +610,7 @@ do_next () {
>  		read -r command rest < "$todo"
>  		mark_action_done
>  		printf 'Executing: %s\n' "$rest"
> -		${SHELL:-@SHELL_PATH@} -c "$rest" # Actual execution
> +		"${SHELL:-@SHELL_PATH@}" -c "$rest" # Actual execution

I think this is the right thing to do (at least I could not think of a
case that would be harmed by it, and it certainly fixes your case). It
looks like filter-branch would need a similar fix?

I think this still isn't resilient to weird meta-characters in the
@SHELL_PATH@, but as this is a build-time option, I think it's OK to let
people who do

  make SHELL_PATH='}"; rm -rf /'

hang themselves.

-Peff

  reply	other threads:[~2015-11-13  6:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13  6:03 [PATCH] rebase-i-exec: Allow space in SHELL_PATH Fredrik Medley
2015-11-13  6:25 ` Jeff King [this message]
2015-11-13 15:25   ` Fredrik Medley
2015-11-13 22:27     ` Jeff King
2015-11-13 22:47       ` Fredrik Medley
2015-11-13 23:09         ` Jeff King
2015-11-16 16:01           ` Johannes Schindelin
2015-11-16 16:34             ` Jeff King
2015-11-13 16:52 ` Matthieu Moy

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=20151113062534.GE32157@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=fredrik.medley@gmail.com \
    --cc=git@vger.kernel.org \
    /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).