Thread (10 messages) flat view 10 messages, 1 author, 2016-06-15
DORMANTno replies

Revision v9 of 4 in this series.

Revisions (4)
  1. v5 [diff vs current]
  2. v6 [diff vs current]
  3. v7 [diff vs current]
  4. v9 current

[PATCH v9 2/9] Stop starting pager recursively

From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2016-06-15 22:53:34
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
 pager.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
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;
 
 	/*
-- 
1.7.3.1.256.g2539c.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help