tag: change default of `pager.tag` to "on"
The previous patch taught `git tag` to only respect `pager.tag` in list-mode. That patch left the default value of `pager.tag` at "off". After that patch, it makes sense to let the default value be "on" instead, since it will help with listing many tags, but will not hurt users of `git tag -a` as it would have before. Make that change. Update documentation and tests. Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Martin Ågren committed
Aug 2, 2017 at 21:40 UTC
ff1e72483f416ecb58737205163031f54c24e754
3 files changed
+16
-16
Documentation/git-tag.txt
+1
-1
@@ -206,7 +206,7 @@ it in the repository configuration as follows:
206
-------------------------------------
207
208
`pager.tag` is only respected when listing tags, i.e., when `-l` is
209
-used or implied.
209
+used or implied. The default is to use a pager.
210
See linkgit:git-config[1].
211
212
DISCUSSION
builtin/tag.c
+1
-1
@@ -462,7 +462,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
462
}
463
464
if (cmdmode == 'l')
465
- setup_auto_pager("tag", 0);
465
+ setup_auto_pager("tag", 1);
466
467
if ((create_tag_object || force) && (cmdmode != 0))
468
usage_with_options(git_tag_usage, options);
t/t7006-pager.sh
+14
-14
@@ -134,16 +134,16 @@ test_expect_success TTY 'configuration can enable pager (from subdir)' '
134
}
135
'
136
137
-test_expect_success TTY 'git tag -l defaults to not paging' '
137
+test_expect_success TTY 'git tag -l defaults to paging' '
138
rm -f paginated.out &&
139
test_terminal git tag -l &&
140
- ! test -e paginated.out
140
+ test -e paginated.out
141
'
142
143
test_expect_success TTY 'git tag -l respects pager.tag' '
144
rm -f paginated.out &&
145
- test_terminal git -c pager.tag tag -l &&
146
- test -e paginated.out
145
+ test_terminal git -c pager.tag=false tag -l &&
146
+ ! test -e paginated.out
147
'
148
149
test_expect_success TTY 'git tag -l respects --no-pager' '
@@ -152,32 +152,32 @@ test_expect_success TTY 'git tag -l respects --no-pager' '
152
! test -e paginated.out
153
'
154
155
-test_expect_success TTY 'git tag with no args defaults to not paging' '
155
+test_expect_success TTY 'git tag with no args defaults to paging' '
156
# no args implies -l so this should page like -l
157
rm -f paginated.out &&
158
test_terminal git tag &&
159
- ! test -e paginated.out
159
+ test -e paginated.out
160
'
161
162
test_expect_success TTY 'git tag with no args respects pager.tag' '
163
# no args implies -l so this should page like -l
164
rm -f paginated.out &&
165
- test_terminal git -c pager.tag tag &&
166
- test -e paginated.out
165
+ test_terminal git -c pager.tag=false tag &&
166
+ ! test -e paginated.out
167
'
168
169
-test_expect_success TTY 'git tag --contains defaults to not paging' '
169
+test_expect_success TTY 'git tag --contains defaults to paging' '
170
# --contains implies -l so this should page like -l
171
rm -f paginated.out &&
172
test_terminal git tag --contains &&
173
- ! test -e paginated.out
173
+ test -e paginated.out
174
'
175
176
test_expect_success TTY 'git tag --contains respects pager.tag' '
177
# --contains implies -l so this should page like -l
178
rm -f paginated.out &&
179
- test_terminal git -c pager.tag tag --contains &&
180
- test -e paginated.out
179
+ test_terminal git -c pager.tag=false tag --contains &&
180
+ ! test -e paginated.out
181
'
182
183
test_expect_success TTY 'git tag -a defaults to not paging' '
@@ -210,8 +210,8 @@ test_expect_failure TTY 'git tag as alias ignores pager.tag with -a' '
210
211
test_expect_success TTY 'git tag as alias respects pager.tag with -l' '
212
rm -f paginated.out &&
213
- test_terminal git -c pager.tag -c alias.t=tag t -l &&
214
- test -e paginated.out
213
+ test_terminal git -c pager.tag=false -c alias.t=tag t -l &&
214
+ ! test -e paginated.out
215
'
216
217
# A colored commit log will begin with an appropriate ANSI escape