Code

am -i, git-svn: use "git var GIT_PAGER"
authorJonathan Nieder <jrnieder@gmail.com>
Sat, 31 Oct 2009 01:43:19 +0000 (20:43 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Nov 2009 20:20:52 +0000 (12:20 -0800)
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 <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-am.sh
git-svn.perl

index c132f50da5f3416e6177dd7010e6db3660bdb073..26494877f44f10be8f105932ad9845ac56e49c05 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -649,7 +649,10 @@ do
                [eE]*) git_editor "$dotest/final-commit"
                       action=again ;;
                [vV]*) action=again
-                      LESS=-S ${PAGER:-less} "$dotest/patch" ;;
+                      : ${GIT_PAGER=$(git var GIT_PAGER)}
+                      : ${LESS=-FRSX}
+                      export LESS
+                      $GIT_PAGER "$dotest/patch" ;;
                *)     action=again ;;
                esac
            done
index 42c9a728adc9e217bd06479562b72235454d7b54..c4ca5487f3b485bb31a692a97c38156239f4bc9c 100755 (executable)
@@ -5171,10 +5171,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);