Skip to content

Commit

Permalink
Merge branch 'ml/pager'
Browse files Browse the repository at this point in the history
  • Loading branch information
Junio C Hamano committed Aug 13, 2006
2 parents 01aaf1f + c27d205 commit 71c8779
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Documentation/git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 71c8779

Please sign in to comment.