summaryrefslogtreecommitdiff
path: root/pager.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-08-07 04:08:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-08-07 04:10:59 (GMT)
commitcad3a2056d2aef3f57c3bb0eccc10614ae69926f (patch)
treea23efe90a43f1094de40948108238f9cd2ca3605 /pager.c
parent3f0a8f3c015f5f2502228a72d8c944d9e700c559 (diff)
downloadgit-cad3a2056d2aef3f57c3bb0eccc10614ae69926f.zip
git-cad3a2056d2aef3f57c3bb0eccc10614ae69926f.tar.gz
git-cad3a2056d2aef3f57c3bb0eccc10614ae69926f.tar.bz2
pager: find out pager setting from configuration
It was very unfortunate that we added core.pager setting to the configuration file; even when the underlying command does not care if there is no git repository is involved (think "git diff --no-index"), the user would now rightfully want the configuration setting to be honored, which means we would need to read the configuration file before we launch the pager. 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. Note that this does not cover "git -p --git-dir where command"; the -p option immediately trigger the pager settings before we even see --git-dir to learn where the configuration file is, so we will end up reading the configuration from the place where we would _normally_ find the git repository. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pager.c')
-rw-r--r--pager.c5
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)