[PATCH v2] Make git send-email accept $EDITOR with arguments
From: Gustaf Hendeby <hidden>
Date: 2016-06-15 22:44:01
Subsystem:
the rest · Maintainer:
Linus Torvalds
Currently git send-email does not accept $EDITOR with arguments, eg, emacs -nw, when starting an editor to produce a cover letter. This fix uses perl's implicit splitting to perform the task and that should hopefully cover most interesting cases. Signed-off-by: Gustaf Hendeby <redacted> --- Thanks to Luciano for the tip to use the internal splitting in perl, that should be a better solution than to split on all spaces. I don't think it is necessary, though, to add an extra error message if the system call fails, system in it self already produces something that should be clear enough. If anyone got a strong oppinion for another error message I'll fix that. Junio, even if this is technically not a bug fix, it would be nice to get this fix into the 1.5.4 so that the usage of $EDITOR becomes more consistent throughout git. /Gustaf 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..5764668 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("$editor $compose_filename"); open(C2,">",$compose_filename . ".final") or die "Failed to open $compose_filename.final : " . $!;
--
1.5.4.rc1.4.gb8173-dirty