summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Lederhofer <matled@gmx.net>2006-07-31 13:27:00 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-07-31 22:51:25 (GMT)
commitc27d205aaefb654c12a4ab9e0b4fae1882c0fc70 (patch)
treedd9a365a38adedb01e836585ce7a19376ae2d2d3
parentaa086eb813d4fe21aac556a94efe5e29b44d8ca4 (diff)
downloadgit-c27d205aaefb654c12a4ab9e0b4fae1882c0fc70.zip
git-c27d205aaefb654c12a4ab9e0b4fae1882c0fc70.tar.gz
git-c27d205aaefb654c12a4ab9e0b4fae1882c0fc70.tar.bz2
pager: environment variable GIT_PAGER to override PAGER
Signed-off-by: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
-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 7310a2b..d243883 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -627,6 +627,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
--- 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;