Skip to content

Commit dec543e

Browse files
jrngitster
authored andcommitted
am -i, git-svn: use "git var GIT_PAGER"
Use the new "git var GIT_PAGER" command to ask what pager to use. Without this change, the core.pager configuration is ignored by these commands. Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b4479f0 commit dec543e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

git-am.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,10 @@ do
649649
[eE]*) git_editor "$dotest/final-commit"
650650
action=again ;;
651651
[vV]*) action=again
652-
LESS=-S ${PAGER:-less} "$dotest/patch" ;;
652+
: ${GIT_PAGER=$(git var GIT_PAGER)}
653+
: ${LESS=-FRSX}
654+
export LESS
655+
$GIT_PAGER "$dotest/patch" ;;
653656
*) action=again ;;
654657
esac
655658
done

git-svn.perl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5171,10 +5171,8 @@ sub git_svn_log_cmd {
51715171

51725172
# adapted from pager.c
51735173
sub config_pager {
5174-
$pager ||= $ENV{GIT_PAGER} || $ENV{PAGER};
5175-
if (!defined $pager) {
5176-
$pager = 'less';
5177-
} elsif (length $pager == 0 || $pager eq 'cat') {
5174+
chomp(my $pager = command_oneline(qw(var GIT_PAGER)));
5175+
if ($pager eq 'cat') {
51785176
$pager = undef;
51795177
}
51805178
$ENV{GIT_PAGER_IN_USE} = defined($pager);

0 commit comments

Comments
 (0)