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)