config: change default of `pager.config` to "on"

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>

Martin Ågren committed Feb 21, 2018 at 19:51 UTC c0e9f5be873d7c6a5df928f167ec1b27027efb45
3 files changed +8 -7
Documentation/git-config.txt
+1
@@ -237,6 +237,7 @@ CONFIGURATION
237 -------------
238 `pager.config` is only respected when listing configuration, i.e., when
239 using `--list` or any of the `--get-*` which may return multiple results.
240 +The default is to use a pager.
241
242 [[FILES]]
243 FILES
builtin/config.c
+1 -1
@@ -602,7 +602,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
602 }
603
604 if (actions & PAGING_ACTIONS)
605 - setup_auto_pager("config", 0);
605 + setup_auto_pager("config", 1);
606
607 if (actions == ACTION_LIST) {
608 check_argc(argc, 0, 0);
t/t7006-pager.sh
+6 -6
@@ -267,23 +267,23 @@ test_expect_success TTY 'git config --get ignores pager.config' '
267 ! test -e paginated.out
268 '
269
270 -test_expect_success TTY 'git config --get-urlmatch defaults to not paging' '
270 +test_expect_success TTY 'git config --get-urlmatch defaults to paging' '
271 rm -f paginated.out &&
272 test_terminal git -c http."https://foo.com/".bar=foo \
273 config --get-urlmatch http https://foo.com &&
274 - ! test -e paginated.out
274 + test -e paginated.out
275 '
276
277 test_expect_success TTY 'git config --get-all respects pager.config' '
278 rm -f paginated.out &&
279 - test_terminal git -c pager.config config --get-all foo.bar &&
280 - test -e paginated.out
279 + test_terminal git -c pager.config=false config --get-all foo.bar &&
280 + ! test -e paginated.out
281 '
282
283 -test_expect_success TTY 'git config --list defaults to not paging' '
283 +test_expect_success TTY 'git config --list defaults to paging' '
284 rm -f paginated.out &&
285 test_terminal git config --list &&
286 - ! test -e paginated.out
286 + test -e paginated.out
287 '
288
289