Code

Make git send-email accept $EDITOR with arguments
authorGustaf Hendeby <hendeby@isy.liu.se>
Sat, 22 Dec 2007 00:40:52 +0000 (01:40 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 22 Dec 2007 08:21:30 +0000 (00:21 -0800)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl

index 248d0350880c17fdcf7cf92afc392bc05dc47825..e47994afc4d6a1dd92c84706dea1b77c1b832114 100755 (executable)
@@ -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 : " . $!;