threads / patch / 5290

patchremove unused pager_in_use

Subject: [PATCH] remove unused pager_in_use

## tl;dr

2 messages between Aug 15, 2006 and Aug 16, 2006. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

David Rientjes· Aug 15, 2006, 20:49 UTC · lore
There's no need to honor pager_in_use because it's unused.
		David
Signed-off-by: David Rientjes <rientjes@google.com>
---
 cache.h       |    1 -
 diff.c        |    2 +-
 environment.c |    1 -
 pager.c       |    2 --
 4 files changed, 1 insertions(+), 5 deletions(-)
Show changes to 4 files +1 −5

cache.h, diff.c, environment.c, pager.c

diff --git a/cache.h b/cache.h
index c738299..7a34728 100644
--- a/cache.h
+++ b/cache.h
@@ -391,7 +391,6 @@ extern int receive_keep_pack(int fd[2], 
 
 /* pager.c */
 extern void setup_pager(void);
-extern int pager_in_use;
 extern int pager_use_color;
 
 /* base85 */
diff --git a/diff.c b/diff.c
index 6a8c0c9..a7eefa8 100644
--- a/diff.c
+++ b/diff.c
@@ -175,7 +175,7 @@ int git_diff_ui_config(const char *var, 
 			diff_use_color_default = 1; /* bool */
 		else if (!strcasecmp(value, "auto")) {
 			diff_use_color_default = 0;
-			if (isatty(1) || (pager_in_use && pager_use_color)) {
+			if (isatty(1) || pager_use_color) {
 				char *term = getenv("TERM");
 				if (term && strcmp(term, "dumb"))
 					diff_use_color_default = 1;
diff --git a/environment.c b/environment.c
index 87162b2..c889816 100644
--- a/environment.c
+++ b/environment.c
@@ -22,7 +22,6 @@ char git_commit_encoding[MAX_ENCODING_LE
 int shared_repository = PERM_UMASK;
 const char *apply_default_whitespace = NULL;
 int zlib_compression_level = Z_DEFAULT_COMPRESSION;
-int pager_in_use;
 int pager_use_color = 1;
 
 static char *git_dir, *git_object_dir, *git_index_file, *git_refs_dir,
diff --git a/pager.c b/pager.c
index dcb398d..40ec566 100644
--- a/pager.c
+++ b/pager.c
@@ -26,8 +26,6 @@ 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();
-- 
1.4.2.g460c-dirty
Johannes Schindelin· Aug 16, 2006, 00:09 UTC · re: David Rientjes · lore

Re: [PATCH] remove unused pager_in_use

Hi,
On Tue, 15 Aug 2006, David Rientjes wrote:
Show 6 quoted lines
> There's no need to honor pager_in_use because it's unused.
>
> [...]
>
> -			if (isatty(1) || (pager_in_use && pager_use_color)) {
> +			if (isatty(1) || pager_use_color) {
Well, it _was_ in use, before you removed it.

Ciao, Dscho

← back to recent threads