Skip to content

Commit 0ae19de

Browse files
Martin Ågrengitster
authored andcommitted
branch: change default of pager.branch to "on"
This is similar to ff1e724 (tag: change default of `pager.tag` to "on", 2017-08-02) and is safe now that we do not consider `pager.branch` at all when we are not listing branches. This change will help with listing many branches, but will not hurt users of `git branch --edit-description` as it would have before the previous commit. Signed-off-by: Martin Ågren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d74b541 commit 0ae19de

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Documentation/git-branch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ start-point is either a local or remote-tracking branch.
274274
CONFIGURATION
275275
-------------
276276
`pager.branch` is only respected when listing branches, i.e., when
277-
`--list` is used or implied.
277+
`--list` is used or implied. The default is to use a pager.
278278
See linkgit:git-config[1].
279279

280280
Examples

builtin/branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
649649
}
650650

651651
if (list)
652-
setup_auto_pager("branch", 0);
652+
setup_auto_pager("branch", 1);
653653

654654
if (delete) {
655655
if (!argc)

t/t7006-pager.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,21 +214,21 @@ test_expect_success TTY 'git tag as alias respects pager.tag with -l' '
214214
! test -e paginated.out
215215
'
216216

217-
test_expect_success TTY 'git branch defaults to not paging' '
217+
test_expect_success TTY 'git branch defaults to paging' '
218218
rm -f paginated.out &&
219219
test_terminal git branch &&
220-
! test -e paginated.out
220+
test -e paginated.out
221221
'
222222

223223
test_expect_success TTY 'git branch respects pager.branch' '
224224
rm -f paginated.out &&
225-
test_terminal git -c pager.branch branch &&
226-
test -e paginated.out
225+
test_terminal git -c pager.branch=false branch &&
226+
! test -e paginated.out
227227
'
228228

229229
test_expect_success TTY 'git branch respects --no-pager' '
230230
rm -f paginated.out &&
231-
test_terminal git -c pager.branch --no-pager branch &&
231+
test_terminal git --no-pager branch &&
232232
! test -e paginated.out
233233
'
234234

0 commit comments

Comments
 (0)