[PATCH v3] Make git send-email accept $EDITOR with arguments
- From
Gustaf Hendeby <hendeby@isy.liu.se>
- Date
- Dec 22, 2007, 00:40 UTC
- Message-ID
- <1198284052-20590-1-git-send-email-hendeby@isy.liu.se>
- In-Reply-To
- <7vd4sz4uii.fsf@gitster.siamese.dyndns.org>
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.gc817f