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

Re: [PATCH] check_repository_format_version(): run git_default_config() again

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 6, 2007, 23:08 UTC
Message-ID
<7vy7go9s84.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vsl6wbe9e.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <gitster@pobox.com> writes:
Show 11 quoted lines
> I see git_config(git_default_config) is called ... big thanks
> for sorting this mess out.
>
> I however have a mild suspicion that this has to be done much
> earlier.
> ...
> We could work this around by having the "we need config -- where
> is it" logic in setup_pager(), but if we later have new options
> like -p that affects the way how git wrapper itself behaves
> based on the configuration, we would need the same "early config
> read" logic to support it.
Ok, how about this as an interim solution?

This is a minimum change in the sense that it restores the old behaviour of not even reading config in setup_git_directory(), but have the core.pager honored when we know it matters.

---
 pager.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/pager.c b/pager.c
index 3bfed02..8bac9d9 100644
--- a/pager.c
+++ b/pager.c
@@ -31,8 +31,11 @@ void setup_pager(void)
 
 	if (!isatty(1))
 		return;
-	if (!pager)
+	if (!pager) {
+		if (!pager_program)
+			git_config(git_default_config);
 		pager = pager_program;
+	}
 	if (!pager)
 		pager = getenv("PAGER");
 	if (!pager)
Previous: Junio C HamanoNext: Johannes Schindelin
Message 4 of 5 in “core.pager handling broken”
  1. Brian GernhardtAug 6, 2007
  2. check_repository_format_version(): run git_default_config() againJohannes Schindelin, Aug 6, 2007
  3. Junio C HamanoAug 6, 2007
  4. Junio C HamanoAug 6, 2007
  5. Johannes SchindelinAug 6, 2007

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.