Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-06-07 03:58:40 +0400
committerJunio C Hamano <junkio@cox.net>2006-07-09 14:27:03 +0400
commit85fb65ed6e41e93760a91b33b512d3d9dc67ac66 (patch)
treee8b00ceee2a8b5880d192609ac80ebfbbeeb0a6d /pager.c
parentcfc01c038709e4cdbf506d29937cac2bc1b76d39 (diff)
"git -p cmd" to page anywhere
This allows you to say: git -p diff v2.6.16-rc5.. and the command pipes the output of any git command to your pager. [jc: this resurrects a month old RFC patch with improvement suggested by Linus to call it --paginate instead of --less.] Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'pager.c')
-rw-r--r--pager.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pager.c b/pager.c
index 2d186e8bde..bb14e99735 100644
--- a/pager.c
+++ b/pager.c
@@ -5,6 +5,8 @@
* something different on Windows, for example.
*/
+int pager_in_use;
+
static void run_pager(const char *pager)
{
execlp(pager, pager, NULL);
@@ -24,6 +26,8 @@ void setup_pager(void)
else if (!*pager || !strcmp(pager, "cat"))
return;
+ pager_in_use = 1; /* means we are emitting to terminal */
+
if (pipe(fd) < 0)
return;
pid = fork();