[PATCH v2] Make git send-email accept $EDITOR with arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <hendeby@xxxxxxxxxx>
---

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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux