branch: change default of `pager.branch` to "on"

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.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 <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Martin Ågren committed Nov 19, 2017 at 16:03 UTC 0ae19de74f6f5d6c6f9c80899e1ecd611c5b9827
3 files changed +7 -7
Documentation/git-branch.txt
+1 -1
@@ -274,7 +274,7 @@ start-point is either a local or remote-tracking branch.
274 CONFIGURATION
275 -------------
276 `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.
278 See linkgit:git-config[1].
279
280 Examples
builtin/branch.c
+1 -1
@@ -649,7 +649,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
649 }
650
651 if (list)
652 - setup_auto_pager("branch", 0);
652 + setup_auto_pager("branch", 1);
653
654 if (delete) {
655 if (!argc)
t/t7006-pager.sh
+5 -5
@@ -214,21 +214,21 @@ test_expect_success TTY 'git tag as alias respects pager.tag with -l' '
214 ! test -e paginated.out
215 '
216
217 -test_expect_success TTY 'git branch defaults to not paging' '
217 +test_expect_success TTY 'git branch defaults to paging' '
218 rm -f paginated.out &&
219 test_terminal git branch &&
220 - ! test -e paginated.out
220 + test -e paginated.out
221 '
222
223 test_expect_success TTY 'git branch respects pager.branch' '
224 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
227 '
228
229 test_expect_success TTY 'git branch respects --no-pager' '
230 rm -f paginated.out &&
231 - test_terminal git -c pager.branch --no-pager branch &&
231 + test_terminal git --no-pager branch &&
232 ! test -e paginated.out
233 '
234