Re: [PATCH v3] Make git send-email accept $EDITOR with arguments
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 22, 2007, 01:05 UTC
- Message-ID
- <7vr6hf35fh.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1198284052-20590-1-git-send-email-hendeby@isy.liu.se>
Gustaf Hendeby <hendeby@isy.liu.se> writes:
Show 29 quoted lines
> Currently git send-email does not accept $EDITOR with arguments, eg,
> emacs -nw, when starting an editor to produce a cover letter. This
> patch changes this by letting the shell handle the option parsing.
>
> Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>
> ---
>
> This is based on Junio's suggestion on most readable and compatible
> solution. I'm not sure if it is identical to the C solution for git
> tag, but it seems to be a reasonable solution.
>
> 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..e47994a 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('sh', '-c', '$0 $@', $editor, $compose_filename);
>
> open(C2,">",$compose_filename . ".final")
> or die "Failed to open $compose_filename.final : " . $!;
> --
> 1.5.4.rc1.16.gc817fThanks. Has this been tested? IOW, did you compose this message with this patch?