From: Luciano Rocha <luciano@eurotux.com>
To: Gustaf Hendeby <hendeby@isy.liu.se>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] Make git send-email accept $EDITOR with arguments
Date: Thu, 20 Dec 2007 20:32:11 +0000 [thread overview]
Message-ID: <20071220203211.GA12296@bit.office.eurotux.com> (raw)
In-Reply-To: <1198181646-28632-1-git-send-email-hendeby@isy.liu.se>
[-- Attachment #1: Type: text/plain, Size: 1349 bytes --]
On Thu, Dec 20, 2007 at 09:14:06PM +0100, Gustaf Hendeby wrote:
<snip>
> I'm not completely satisfied with the problem with embedded spaces,
> but my Perl skills aren't good enough to do anything about it. If
> anyone have any suggestions on how to do it, it would be greatly
> appreciated. None-the-less, even with this shortcoming, I think this
> is a step in the right direction.
>
> git-send-email.perl | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 248d035..47ae77c 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -400,7 +400,7 @@ EOT
> close(C);
>
> my $editor = $ENV{GIT_EDITOR} || $repo->config("core.editor") || $ENV{VISUAL} || $ENV{EDITOR} || "vi";
> - system($editor, $compose_filename);
> + system((split ' ', $editor), $compose_filename);
That should be enough. Use system("$editor $compose_filename") to use
perl's implicit split or, in case of meta-characters in the string,
external sh -c.
Or always use the shell:
$shell = $ENV{SHELL} || "/bin/sh";
system($shell, "-c", "$editor $compose_filename");
BTW, maybe add a check for the return code?
system(...) == 0 or die "editor failed\n";
--
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-12-20 20:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-20 20:14 [PATCH] Make git send-email accept $EDITOR with arguments Gustaf Hendeby
2007-12-20 20:32 ` Luciano Rocha [this message]
2007-12-21 11:36 ` [PATCH v2] " Gustaf Hendeby
2007-12-21 13:34 ` Jeff King
2007-12-21 15:23 ` Gustaf Hendeby
2007-12-21 19:23 ` Jeff King
2007-12-21 21:07 ` Gustaf Hendeby
2007-12-21 21:17 ` Junio C Hamano
2007-12-22 0:40 ` [PATCH v3] " Gustaf Hendeby
2007-12-22 1:05 ` Junio C Hamano
2007-12-22 8:47 ` Gustaf Hendeby
2007-12-21 17:02 ` [PATCH v2] " Junio C Hamano
2007-12-22 0:43 ` [PATCH] Move git send-email cover letter temporary file to $GIT_DIR Gustaf Hendeby
2007-12-22 1:09 ` Junio C Hamano
2007-12-22 1:18 ` David Symonds
2007-12-22 6:49 ` Junio C Hamano
2007-12-22 7:04 ` David Symonds
2007-12-22 8:52 ` Junio C Hamano
2007-12-22 9:13 ` Gustaf Hendeby
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=20071220203211.GA12296@bit.office.eurotux.com \
--to=luciano@eurotux.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hendeby@isy.liu.se \
/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).