Skip to content

Commit c0e9f5b

Browse files
Martin Ågrengitster
authored andcommitted
config: change default of pager.config to "on"
This is similar to ff1e724 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 32888b8 commit c0e9f5b

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Documentation/git-config.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ CONFIGURATION
237237
-------------
238238
`pager.config` is only respected when listing configuration, i.e., when
239239
using `--list` or any of the `--get-*` which may return multiple results.
240+
The default is to use a pager.
240241

241242
[[FILES]]
242243
FILES

builtin/config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
602602
}
603603

604604
if (actions & PAGING_ACTIONS)
605-
setup_auto_pager("config", 0);
605+
setup_auto_pager("config", 1);
606606

607607
if (actions == ACTION_LIST) {
608608
check_argc(argc, 0, 0);

t/t7006-pager.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,23 +267,23 @@ test_expect_success TTY 'git config --get ignores pager.config' '
267267
! test -e paginated.out
268268
'
269269

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' '
271271
rm -f paginated.out &&
272272
test_terminal git -c http."https://foo.com/".bar=foo \
273273
config --get-urlmatch http https://foo.com &&
274-
! test -e paginated.out
274+
test -e paginated.out
275275
'
276276

277277
test_expect_success TTY 'git config --get-all respects pager.config' '
278278
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
281281
'
282282

283-
test_expect_success TTY 'git config --list defaults to not paging' '
283+
test_expect_success TTY 'git config --list defaults to paging' '
284284
rm -f paginated.out &&
285285
test_terminal git config --list &&
286-
! test -e paginated.out
286+
test -e paginated.out
287287
'
288288

289289

0 commit comments

Comments
 (0)