From 85fb65ed6e41e93760a91b33b512d3d9dc67ac66 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 6 Jun 2006 16:58:40 -0700 Subject: "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 --- diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'diff.c') diff --git a/diff.c b/diff.c index 3e26180f08..a00f9d1e52 100644 --- a/diff.c +++ b/diff.c @@ -112,7 +112,7 @@ int git_diff_config(const char *var, const char *value) diff_use_color_default = 1; /* bool */ else if (!strcasecmp(value, "auto")) { diff_use_color_default = 0; - if (isatty(1)) { + if (isatty(1) || pager_in_use) { char *term = getenv("TERM"); if (term && strcmp(term, "dumb")) diff_use_color_default = 1; -- cgit v1.2.3