diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-03-21 11:30:09 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-21 11:30:09 -0700 |
commit | 75901dfd52ef97df51621a23156db96c9cd4a90b (patch) | |
tree | 4c7631526ba4c2cecd0dbd53fe5dcf14c24b5e0a /builtin/config.c | |
parent | Git 2.17-rc0 (diff) | |
parent | config: change default of `pager.config` to "on" (diff) | |
download | tgif-75901dfd52ef97df51621a23156db96c9cd4a90b.tar.xz |
Merge branch 'ma/config-page-only-in-list-mode'
In a way similar to how "git tag" learned to honor the pager
setting only in the list mode, "git config" learned to ignore the
pager setting when it is used for setting values (i.e. when the
purpose of the operation is not to "show").
* ma/config-page-only-in-list-mode:
config: change default of `pager.config` to "on"
config: respect `pager.config` in list/get-mode only
t7006: add tests for how git config paginates
Diffstat (limited to 'builtin/config.c')
-rw-r--r-- | builtin/config.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin/config.c b/builtin/config.c index ab5f95476e..01169dd628 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -48,6 +48,13 @@ static int show_origin; #define ACTION_GET_COLORBOOL (1<<14) #define ACTION_GET_URLMATCH (1<<15) +/* + * The actions "ACTION_LIST | ACTION_GET_*" which may produce more than + * one line of output and which should therefore be paged. + */ +#define PAGING_ACTIONS (ACTION_LIST | ACTION_GET_ALL | \ + ACTION_GET_REGEXP | ACTION_GET_URLMATCH) + #define TYPE_BOOL (1<<0) #define TYPE_INT (1<<1) #define TYPE_BOOL_OR_INT (1<<2) @@ -594,6 +601,9 @@ int cmd_config(int argc, const char **argv, const char *prefix) usage_with_options(builtin_config_usage, builtin_config_options); } + if (actions & PAGING_ACTIONS) + setup_auto_pager("config", 1); + if (actions == ACTION_LIST) { check_argc(argc, 0, 0); if (config_with_options(show_all_config, NULL, |