Merge branch 'ml/pager'

This commit is contained in:
Junio C Hamano 2006-08-12 19:13:25 -07:00
commit 71c87795c3
2 changed files with 6 additions and 1 deletions

View File

@ -633,6 +633,9 @@ git Diffs
other other
~~~~~ ~~~~~
'GIT_PAGER'::
This environment variable overrides `$PAGER`.
'GIT_TRACE':: 'GIT_TRACE'::
If this variable is set git will print `trace:` messages on If this variable is set git will print `trace:` messages on
stderr telling about alias expansion, built-in command stderr telling about alias expansion, built-in command

View File

@ -15,10 +15,12 @@ void setup_pager(void)
{ {
pid_t pid; pid_t pid;
int fd[2]; int fd[2];
const char *pager = getenv("PAGER"); const char *pager = getenv("GIT_PAGER");
if (!isatty(1)) if (!isatty(1))
return; return;
if (!pager)
pager = getenv("PAGER");
if (!pager) if (!pager)
pager = "less"; pager = "less";
else if (!*pager || !strcmp(pager, "cat")) else if (!*pager || !strcmp(pager, "cat"))