diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-11-20 23:48:52 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-11-20 23:48:52 -0800 |
commit | 376f39fbea0dfb31402abda878a7b0018f6a6161 (patch) | |
tree | d97dd8a947407fc4c36a97ad7b8b37e6b8142e9e /git-svn.perl | |
parent | 7a4383cf13819cd2ef00f0d60318aad3f1813117 (diff) | |
parent | a3d023d0a3783612053f2149e784b43befceccad (diff) | |
download | git-376f39fbea0dfb31402abda878a7b0018f6a6161.tar.gz |
Merge branch 'jn/editor-pager'
* jn/editor-pager:
Provide a build time default-pager setting
Provide a build time default-editor setting
am -i, git-svn: use "git var GIT_PAGER"
add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"
Teach git var about GIT_PAGER
Teach git var about GIT_EDITOR
Suppress warnings from "git var -l"
Do not use VISUAL editor on dumb terminals
Handle more shell metacharacters in editor names
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-x | git-svn.perl | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/git-svn.perl b/git-svn.perl index ab0a8dd099..2746895ae6 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -1332,9 +1332,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 $!; { @@ -5219,10 +5218,8 @@ sub git_svn_log_cmd { # adapted from pager.c sub config_pager { - $pager ||= $ENV{GIT_PAGER} || $ENV{PAGER}; - if (!defined $pager) { - $pager = 'less'; - } elsif (length $pager == 0 || $pager eq 'cat') { + chomp(my $pager = command_oneline(qw(var GIT_PAGER))); + if ($pager eq 'cat') { $pager = undef; } $ENV{GIT_PAGER_IN_USE} = defined($pager); |