summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-08-12 19:13:25 -0700
committerJunio C Hamano <junkio@cox.net>2006-08-12 19:13:25 -0700
commit71c87795c3f724a88c2f1f95aa21f212efc69b66 (patch)
tree817d8705f7d3fc4b5be3e43e169d671b99a581dc
parent01aaf1f88ddc2b99162c302710339f202996f39b (diff)
parentc27d205aaefb654c12a4ab9e0b4fae1882c0fc70 (diff)
downloadgit-71c87795c3f724a88c2f1f95aa21f212efc69b66.tar.gz
Merge branch 'ml/pager'
-rw-r--r--Documentation/git.txt3
-rw-r--r--pager.c4
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
diff --git a/pager.c b/pager.c
index 280f57f796..dcb398da8e 100644
--- a/pager.c
+++ b/pager.c
@@ -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;