diff options
-rw-r--r-- | Documentation/git.txt | 3 | ||||
-rw-r--r-- | pager.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/Documentation/git.txt b/Documentation/git.txt index bcf187a11c..3de5fa9c82 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -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 @@ -15,11 +15,13 @@ 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")) return; |