git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] pager_in_use: use git_env_bool

From
Jeff King <peff@peff.net>
Date
Aug 10, 2015, 05:19 UTC
Message-ID
<20150810051933.GA15441@sigill.intra.peff.net>
In-Reply-To
<20150810051901.GA9262@sigill.intra.peff.net>

This function basically reimplements git_env_bool (because it predates it). Let's reuse that helper, which is shorter and avoids repeating a string literal.

Signed-off-by: Jeff King <peff@peff.net>
---
 pager.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/pager.c b/pager.c
index 070dc11..e3ad465 100644
--- a/pager.c
+++ b/pager.c
@@ -95,9 +95,7 @@ void setup_pager(void)
 
 int pager_in_use(void)
 {
-	const char *env;
-	env = getenv("GIT_PAGER_IN_USE");
-	return env ? git_config_bool("GIT_PAGER_IN_USE", env) : 0;
+	return git_env_bool("GIT_PAGER_IN_USE", 0);
 }
 
 /*
-- 
2.5.0.414.g670f2a4
Previous: Jeff KingNext: Jeff King
Message 4 of 8 in “"git pull --rebase" fails if pager.pull is true, after producing a colorized diff it cannot apply”
  1. Per CederqvistAug 3, 2015
  2. Jeff KingAug 9, 2015
  3. Jeff KingAug 10, 2015
  4. 1/2 pager_in_use: use git_env_boolJeff King, Aug 10, 2015
  5. 2/2 pager_in_use: make sure output is still going to pagerJeff King, Aug 10, 2015
  6. Johannes SchindelinAug 10, 2015
  7. Jeff KingAug 10, 2015
  8. Per CederqvistAug 11, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.