Merge branch 'ma/branch-list-paginate'
authorJunio C Hamano <gitster@pobox.com>
Tue, 28 Nov 2017 04:41:49 +0000 (13:41 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Nov 2017 04:41:50 +0000 (13:41 +0900)
"git branch --list" learned to show its output through the pager by
default when the output is going to a terminal, which is controlled
by the pager.branch configuration variable. This is similar to a
recent change to "git tag --list".

* ma/branch-list-paginate:
branch: change default of `pager.branch` to "on"
branch: respect `pager.branch` in list-mode only
t7006: add tests for how git branch paginates

1  2 
Documentation/git-branch.txt
builtin/branch.c
git.c
t/t7006-pager.sh
index d6587c5e96f4dbcdb4176d9dd5f6a992c0e83f3b,ef187ba7cfec284ef472f76462eb655c831ee0d6..520c53b5e8bd3792c349db1895fa2e5608ca0a08
@@@ -277,10 -267,16 +277,16 @@@ start-point is either a local or remote
        Only list branches of the given object.
  
  --format <format>::
 -      A string that interpolates `%(fieldname)` from the object
 -      pointed at by a ref being shown.  The format is the same as
 +      A string that interpolates `%(fieldname)` from a branch ref being shown
 +      and the object it points at.  The format is the same as
        that of linkgit:git-for-each-ref[1].
  
+ CONFIGURATION
+ -------------
+ `pager.branch` is only respected when listing branches, i.e., when
+ `--list` is used or implied. The default is to use a pager.
+ See linkgit:git-config[1].
  Examples
  --------
  
index 5fc57cdc982f86d6e449d8358004c476707d909c,39fa99bba74d8e9b2528c9c4267d94a88ccc748c..af95ad2192004ad3a712c15f1e50356daadb7c86
@@@ -672,9 -646,11 +672,12 @@@ int cmd_branch(int argc, const char **a
        if (force) {
                delete *= 2;
                rename *= 2;
 +              copy *= 2;
        }
  
+       if (list)
+               setup_auto_pager("branch", 1);
        if (delete) {
                if (!argc)
                        die(_("branch name required"));
diff --cc git.c
Simple merge
Simple merge