Browse Source

Merge branch 'ml/pager'

maint
Junio C Hamano 19 years ago
parent
commit
71c87795c3
  1. 3
      Documentation/git.txt
  2. 4
      pager.c

3
Documentation/git.txt

@ -633,6 +633,9 @@ git Diffs @@ -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

4
pager.c

@ -15,10 +15,12 @@ void setup_pager(void) @@ -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"))

Loading…
Cancel
Save