git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] config: change default of `pager.config` to "on"

From
MÅMartin Ågren <martin.agren@gmail.com>
Date
Feb 11, 2018, 16:40 UTC
Message-ID
<cb4440e4f910f7095f16144afcc5963445211482.1518365675.git.martin.agren@gmail.com>
In-Reply-To
<450ff45707b58d6796d55cd594b50686e5d62fc2.1518365675.git.martin.agren@gmail.com>

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>
---
 Documentation/git-config.txt |  2 +-
 t/t7006-pager.sh             | 12 ++++++------
 builtin/config.c             |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index ccc8f0bcff..78074cf3b2 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -236,7 +236,7 @@ See also <<FILES>>.
 CONFIGURATION
 -------------
 `pager.config` is only respected when listing configuration, i.e., when
-`--list`, `--get` or any of `--get-*` is used.
+`--list`, `--get` or any of `--get-*` is used. The default is to use a pager.
 
 [[FILES]]
 FILES
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 869a0359a8..47f7830eb1 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -261,22 +261,22 @@ test_expect_success TTY 'git config --edit ignores pager.config' '
 	test -e editor.used
 '
 
-test_expect_success TTY 'git config --get defaults to not paging' '
+test_expect_success TTY 'git config --get defaults to paging' '
 	rm -f paginated.out &&
 	test_terminal git config --get foo.bar &&
-	! test -e paginated.out
+	test -e paginated.out
 '
 
 test_expect_success TTY 'git config --get respects pager.config' '
 	rm -f paginated.out &&
-	test_terminal git -c pager.config config --get foo.bar &&
-	test -e paginated.out
+	test_terminal git -c pager.config=false config --get 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
 '
 
 
diff --git a/builtin/config.c b/builtin/config.c
index 9a57a0caff..61808a93cb 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -600,7 +600,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 	}
 
 	if (actions & ACTION_LIST_OR_GET)
-		setup_auto_pager("config", 0);
+		setup_auto_pager("config", 1);
 
 	if (actions == ACTION_LIST) {
 		check_argc(argc, 0, 0);
-- 
2.16.1.72.g5be1f00a9a
Previous: Martin ÅgrenNext: Junio C Hamano
Message 5 of 12 in “t7006: add tests for how git config paginates”
  1. 1/3 t7006: add tests for how git config paginatesMartin Ågren, Feb 11, 2018
  2. 2/3 config: respect `pager.config` in list/get-mode onlyMartin Ågren, Feb 11, 2018
  3. Duy NguyenFeb 13, 2018
  4. Martin ÅgrenFeb 13, 2018
  5. 3/3 config: change default of `pager.config` to "on"Martin Ågren, Feb 11, 2018
  6. Junio C HamanoFeb 12, 2018
  7. Martin ÅgrenFeb 12, 2018
  8. 0/3 Re: t7006: add tests for how git config paginatesMartin Ågren, Feb 21, 2018
  9. 1/3 t7006: add tests for how git config paginatesMartin Ågren, Feb 21, 2018
  10. 2/3 config: respect `pager.config` in list/get-mode onlyMartin Ågren, Feb 21, 2018
  11. 3/3 config: change default of `pager.config` to "on"Martin Ågren, Feb 21, 2018
  12. Junio C HamanoFeb 21, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.