Skip to content

Commit

Permalink
Stop starting pager recursively
Browse files Browse the repository at this point in the history
git-column can be used as a pager for other git commands, something
like this:

    GIT_PAGER="git -p column --mode='dense color'" git -p branch

The problem with this is that "git -p column" also has $GIT_PAGER set so
the pager runs itself again as another pager. The end result is an
infinite loop of forking. Other git commands have the same problem if
being abused this way.

Check if $GIT_PAGER is already set and stop launching another pager.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
pclouds authored and gitster committed Apr 27, 2012
1 parent 7e29b82 commit 88e8f90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void setup_pager(void)
{
const char *pager = git_pager(isatty(1));

if (!pager)
if (!pager || pager_in_use())
return;

/*
Expand Down

0 comments on commit 88e8f90

Please sign in to comment.