aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2009-10-30 20:42:34 -0500
committerJunio C Hamano <gitster@pobox.com>2009-11-13 12:20:50 -0800
commitb4479f074760a788dd4e353b8c86a7d735afc53e (patch)
tree5680844fb47dd256945296a8466de81a4bfb17ec /git-svn.perl
parent6361824589bc2d32989a9a33f985d09a368436a3 (diff)
downloadgit-b4479f074760a788dd4e353b8c86a7d735afc53e.tar.gz
git-b4479f074760a788dd4e353b8c86a7d735afc53e.tar.xz
add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"
Use the new "git var GIT_EDITOR" feature to decide what editor to use, instead of duplicating its logic elsewhere. This should make the behavior of commands in edge cases (e.g., editor names with spaces) a little more consistent. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl5
1 files changed, 2 insertions, 3 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 6a3b501d2..42c9a728a 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1321,9 +1321,8 @@ sub get_commit_entry {
close $log_fh or croak $!;
if ($_edit || ($type eq 'tree')) {
- my $editor = $ENV{VISUAL} || $ENV{EDITOR} || 'vi';
- # TODO: strip out spaces, comments, like git-commit.sh
- system($editor, $commit_editmsg);
+ chomp(my $editor = command_oneline(qw(var GIT_EDITOR)));
+ system('sh', '-c', $editor.' "$@"', $editor, $commit_editmsg);
}
rename $commit_editmsg, $commit_msg or croak $!;
{