git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Martin Ågren" <martin.agren@gmail.com>
To: git@vger.kernel.org
Cc: Duy Nguyen <pclouds@gmail.com>, Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v2 3/3] config: change default of `pager.config` to "on"
Date: Wed, 21 Feb 2018 19:51:44 +0100	[thread overview]
Message-ID: <bb68a11f51024980e513c1f001b5759a35829ff1.1519238410.git.martin.agren@gmail.com> (raw)
In-Reply-To: <cover.1519238410.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 |  1 +
 t/t7006-pager.sh             | 12 ++++++------
 builtin/config.c             |  2 +-
 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/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
 '
 
 
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);
-- 
2.16.2.246.ga4ee44448f


  parent reply	other threads:[~2018-02-21 18:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-11 16:40 [PATCH 1/3] t7006: add tests for how git config paginates Martin Ågren
2018-02-11 16:40 ` [PATCH 2/3] config: respect `pager.config` in list/get-mode only Martin Ågren
2018-02-13 10:25   ` Duy Nguyen
2018-02-13 11:19     ` Martin Ågren
2018-02-11 16:40 ` [PATCH 3/3] config: change default of `pager.config` to "on" Martin Ågren
2018-02-12 22:17 ` [PATCH 1/3] t7006: add tests for how git config paginates Junio C Hamano
2018-02-12 22:41   ` Martin Ågren
2018-02-21 18:51 ` [PATCH v2 0/3] " Martin Ågren
2018-02-21 18:51   ` [PATCH v2 1/3] " Martin Ågren
2018-02-21 18:51   ` [PATCH v2 2/3] config: respect `pager.config` in list/get-mode only Martin Ågren
2018-02-21 18:51   ` Martin Ågren [this message]
2018-02-21 22:35   ` [PATCH v2 0/3] Re: t7006: add tests for how git config paginates Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bb68a11f51024980e513c1f001b5759a35829ff1.1519238410.git.martin.agren@gmail.com \
    --to=martin.agren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).