branch: change default of `pager.branch` to "on"
authorMartin Ågren <martin.agren@gmail.com>
Sun, 19 Nov 2017 15:03:50 +0000 (16:03 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Nov 2017 00:50:25 +0000 (09:50 +0900)
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>
Documentation/git-branch.txt
builtin/branch.c
t/t7006-pager.sh
index 9dae1ea29568cf25da477e2d0832931794b18c81..ef187ba7cfec284ef472f76462eb655c831ee0d6 100644 (file)
@@ -274,7 +274,7 @@ start-point is either a local or remote-tracking branch.
 CONFIGURATION
 -------------
 `pager.branch` is only respected when listing branches, i.e., when
-`--list` is used or implied.
+`--list` is used or implied. The default is to use a pager.
 See linkgit:git-config[1].
 
 Examples
index 3eb31cd1edf39591646e39b1963805da57c54377..39fa99bba74d8e9b2528c9c4267d94a88ccc748c 100644 (file)
@@ -649,7 +649,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
        }
 
        if (list)
-               setup_auto_pager("branch", 0);
+               setup_auto_pager("branch", 1);
 
        if (delete) {
                if (!argc)
index 5998f7135b563a91de051d6d7839148c05f2b9d0..f59dfd143209ef6b5fec7e5e8b92e9682f407392 100755 (executable)
@@ -214,21 +214,21 @@ test_expect_success TTY 'git tag as alias respects pager.tag with -l' '
        ! test -e paginated.out
 '
 
-test_expect_success TTY 'git branch defaults to not paging' '
+test_expect_success TTY 'git branch defaults to paging' '
        rm -f paginated.out &&
        test_terminal git branch &&
-       test -e paginated.out
+       test -e paginated.out
 '
 
 test_expect_success TTY 'git branch respects pager.branch' '
        rm -f paginated.out &&
-       test_terminal git -c pager.branch branch &&
-       test -e paginated.out
+       test_terminal git -c pager.branch=false branch &&
+       test -e paginated.out
 '
 
 test_expect_success TTY 'git branch respects --no-pager' '
        rm -f paginated.out &&
-       test_terminal git -c pager.branch --no-pager branch &&
+       test_terminal git --no-pager branch &&
        ! test -e paginated.out
 '