From c0e9f5be873d7c6a5df928f167ec1b27027efb45 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20=C3=85gren?= Date: Wed, 21 Feb 2018 19:51:44 +0100 Subject: [PATCH] config: change default of `pager.config` to "on" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is similar to ff1e72483 (tag: change default of `pager.tag` to "on", 2017-08-02) and is safe now that we do not consider `pager.config` at all when we are not listing or getting configuration. This change will help with listing large configurations, but will not hurt users of `git config --edit` as it would have before the previous commit. Signed-off-by: Martin Ă…gren Signed-off-by: Junio C Hamano --- Documentation/git-config.txt | 1 + builtin/config.c | 2 +- t/t7006-pager.sh | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index 249090ac84..e09ed5d7d5 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -237,6 +237,7 @@ CONFIGURATION ------------- `pager.config` is only respected when listing configuration, i.e., when using `--list` or any of the `--get-*` which may return multiple results. +The default is to use a pager. [[FILES]] FILES diff --git a/builtin/config.c b/builtin/config.c index a732d9b56c..01169dd628 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -602,7 +602,7 @@ int cmd_config(int argc, const char **argv, const char *prefix) } if (actions & PAGING_ACTIONS) - setup_auto_pager("config", 0); + setup_auto_pager("config", 1); if (actions == ACTION_LIST) { check_argc(argc, 0, 0); diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh index 95bd26f0b2..7541ba5edb 100755 --- a/t/t7006-pager.sh +++ b/t/t7006-pager.sh @@ -267,23 +267,23 @@ test_expect_success TTY 'git config --get ignores pager.config' ' ! test -e paginated.out ' -test_expect_success TTY 'git config --get-urlmatch defaults to not paging' ' +test_expect_success TTY 'git config --get-urlmatch defaults to paging' ' rm -f paginated.out && test_terminal git -c http."https://foo.com/".bar=foo \ config --get-urlmatch http https://foo.com && - ! test -e paginated.out + test -e paginated.out ' test_expect_success TTY 'git config --get-all respects pager.config' ' rm -f paginated.out && - test_terminal git -c pager.config config --get-all foo.bar && - test -e paginated.out + test_terminal git -c pager.config=false config --get-all foo.bar && + ! test -e paginated.out ' -test_expect_success TTY 'git config --list defaults to not paging' ' +test_expect_success TTY 'git config --list defaults to paging' ' rm -f paginated.out && test_terminal git config --list && - ! test -e paginated.out + test -e paginated.out ' -- 2.11.4.GIT