From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH v9 2/9] Stop starting pager recursively
Date: Fri, 13 Apr 2012 17:54:34 +0700 [thread overview]
Message-ID: <1334314481-14470-3-git-send-email-pclouds@gmail.com> (raw)
In-Reply-To: <1334314481-14470-1-git-send-email-pclouds@gmail.com>
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>
---
| 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
--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
next prev parent reply other threads:[~2012-04-13 10:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 10:54 [PATCH v9 0/9] Column display Nguyễn Thái Ngọc Duy
2012-04-13 10:54 ` [PATCH v9 1/9] Add column layout skeleton and git-column Nguyễn Thái Ngọc Duy
2012-04-16 5:38 ` Junio C Hamano
2012-04-16 13:26 ` [PATCH] " Nguyễn Thái Ngọc Duy
2012-04-16 16:05 ` Junio C Hamano
2012-04-21 3:07 ` Nguyễn Thái Ngọc Duy
2012-04-21 4:18 ` Junio C Hamano
2012-04-21 4:44 ` Nguyễn Thái Ngọc Duy
2012-04-21 5:40 ` Junio C Hamano
2012-04-13 10:54 ` Nguyễn Thái Ngọc Duy [this message]
2012-04-13 10:54 ` [PATCH v9 3/9] column: add columnar layout Nguyễn Thái Ngọc Duy
2012-04-13 10:54 ` [PATCH v9 4/9] column: add dense layout support Nguyễn Thái Ngọc Duy
2012-04-13 10:54 ` [PATCH v9 5/9] help: reuse print_columns() for help -a Nguyễn Thái Ngọc Duy
2012-04-13 10:54 ` [PATCH v9 6/9] branch: add --column Nguyễn Thái Ngọc Duy
2012-04-13 10:54 ` [PATCH v9 7/9] status: " Nguyễn Thái Ngọc Duy
2012-04-13 10:54 ` [PATCH v9 8/9] column: support piping stdout to external git-column process Nguyễn Thái Ngọc Duy
2012-04-13 10:54 ` [PATCH v9 9/9] tag: add --column Nguyễn Thái Ngọc Duy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1334314481-14470-3-git-send-email-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).