Merge branch 'ml/pager'
authorJunio C Hamano <junkio@cox.net>
Sun, 13 Aug 2006 02:13:25 +0000 (19:13 -0700)
committerJunio C Hamano <junkio@cox.net>
Sun, 13 Aug 2006 02:13:25 +0000 (19:13 -0700)
Documentation/git.txt
pager.c

index bcf187a..3de5fa9 100644 (file)
@@ -633,6 +633,9 @@ git Diffs
 
 other
 ~~~~~
+'GIT_PAGER'::
+       This environment variable overrides `$PAGER`.
+
 'GIT_TRACE'::
        If this variable is set git will print `trace:` messages on
        stderr telling about alias expansion, built-in command
diff --git a/pager.c b/pager.c
index 280f57f..dcb398d 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -15,10 +15,12 @@ void setup_pager(void)
 {
        pid_t pid;
        int fd[2];
-       const char *pager = getenv("PAGER");
+       const char *pager = getenv("GIT_PAGER");
 
        if (!isatty(1))
                return;
+       if (!pager)
+               pager = getenv("PAGER");
        if (!pager)
                pager = "less";
        else if (!*pager || !strcmp(pager, "cat"))