From 88e8f908f2b0c56f9ccf8134d8ff9f689af9cc84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 13 Apr 2012 17:54:34 +0700 Subject: Stop starting pager recursively MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano diff --git a/pager.c b/pager.c index 05584de..4dcb08d 100644 --- a/pager.c +++ b/pager.c @@ -73,7 +73,7 @@ void setup_pager(void) { const char *pager = git_pager(isatty(1)); - if (!pager) + if (!pager || pager_in_use()) return; /* -- cgit v0.10.2-6-g49f6