config: change default of `pager.config` to "on"
authorMartin Ågren <martin.agren@gmail.com>
Wed, 21 Feb 2018 18:51:44 +0000 (19:51 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Feb 2018 22:27:30 +0000 (14:27 -0800)
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 <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-config.txt
builtin/config.c
t/t7006-pager.sh
index 249090ac846b810c7a9561070c1f7cf36128e8f2..e09ed5d7d5147d93039c479efc8ab450bf5ca8b4 100644 (file)
@@ -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
index a732d9b56c0a9f9a7f514b917da3820a502b7315..01169dd628b24a7b5502550a6342ab73cb8154c5 100644 (file)
@@ -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);
index 95bd26f0b2394a34252074dbf2ff5ee9ed56d9d3..7541ba5edbcae1f1555c367b7f8bfc795913ff60 100755 (executable)
@@ -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
 '