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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> 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)

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux