Skip to content

Commit ff1e724

Browse files
Martin Ågrengitster
Martin Ågren
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent de121ff commit ff1e724

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

Documentation/git-tag.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ it in the repository configuration as follows:
206206
-------------------------------------
207207

208208
`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.
210210
See linkgit:git-config[1].
211211

212212
DISCUSSION

builtin/tag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
462462
}
463463

464464
if (cmdmode == 'l')
465-
setup_auto_pager("tag", 0);
465+
setup_auto_pager("tag", 1);
466466

467467
if ((create_tag_object || force) && (cmdmode != 0))
468468
usage_with_options(git_tag_usage, options);

t/t7006-pager.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,16 @@ test_expect_success TTY 'configuration can enable pager (from subdir)' '
134134
}
135135
'
136136

137-
test_expect_success TTY 'git tag -l defaults to not paging' '
137+
test_expect_success TTY 'git tag -l defaults to paging' '
138138
rm -f paginated.out &&
139139
test_terminal git tag -l &&
140-
! test -e paginated.out
140+
test -e paginated.out
141141
'
142142

143143
test_expect_success TTY 'git tag -l respects pager.tag' '
144144
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
147147
'
148148

149149
test_expect_success TTY 'git tag -l respects --no-pager' '
@@ -152,32 +152,32 @@ test_expect_success TTY 'git tag -l respects --no-pager' '
152152
! test -e paginated.out
153153
'
154154

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' '
156156
# no args implies -l so this should page like -l
157157
rm -f paginated.out &&
158158
test_terminal git tag &&
159-
! test -e paginated.out
159+
test -e paginated.out
160160
'
161161

162162
test_expect_success TTY 'git tag with no args respects pager.tag' '
163163
# no args implies -l so this should page like -l
164164
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
167167
'
168168

169-
test_expect_success TTY 'git tag --contains defaults to not paging' '
169+
test_expect_success TTY 'git tag --contains defaults to paging' '
170170
# --contains implies -l so this should page like -l
171171
rm -f paginated.out &&
172172
test_terminal git tag --contains &&
173-
! test -e paginated.out
173+
test -e paginated.out
174174
'
175175

176176
test_expect_success TTY 'git tag --contains respects pager.tag' '
177177
# --contains implies -l so this should page like -l
178178
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
181181
'
182182

183183
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' '
210210

211211
test_expect_success TTY 'git tag as alias respects pager.tag with -l' '
212212
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
215215
'
216216

217217
# A colored commit log will begin with an appropriate ANSI escape

0 commit comments

Comments
 (0)