Git development
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Chris Lasell <chrisl@pixar.com>, git@vger.kernel.org
Subject: Re: Bug: git-p4 edit_template() and P4EDITOR w/options
Date: Mon, 4 May 2015 16:11:36 -0700	[thread overview]
Message-ID: <20150504231136.GY5467@google.com> (raw)
In-Reply-To: <xmqqvbg8netq.fsf@gitster.dls.corp.google.com>

Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:

>> Perhaps a single-liner patch like this would work?
>>
>> -	system([editor, template_file])
>> +	system(["sh", "-c", editor, template_file])
>
> Nah, scratch that.  The list should be more like
>
> 	["sh", "-c", "%s %s" % (editor, shlex.quote(template_file))]

*nod*

run-command.c does

	system(["sh", "-c", ('%s "$@"' % editor), editor, template_file])

to avoid having to figure out how to shell-quote template_file.

  reply	other threads:[~2015-05-04 23:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04 21:26 Bug: git-p4 edit_template() and P4EDITOR w/options Chris Lasell
2015-05-04 22:01 ` Junio C Hamano
2015-05-04 22:34   ` Junio C Hamano
2015-05-04 22:38     ` Junio C Hamano
2015-05-04 22:44       ` Junio C Hamano
2015-05-04 23:11         ` Jonathan Nieder [this message]
2015-05-05  0:22           ` Junio C Hamano
2015-05-04 22:46       ` Chris Lasell

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=20150504231136.GY5467@google.com \
    --to=jrnieder@gmail.com \
    --cc=chrisl@pixar.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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