From: Junio C Hamano Date: Tue, 28 Nov 2017 04:41:49 +0000 (+0900) Subject: Merge branch 'ma/branch-list-paginate' X-Git-Tag: v2.16.0-rc0~88 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/3b49e1b0e900a88cab9e1b035dac83c0dd6ae2b3?hp=--cc Merge branch 'ma/branch-list-paginate' "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 --- 3b49e1b0e900a88cab9e1b035dac83c0dd6ae2b3 diff --cc Documentation/git-branch.txt index d6587c5e96,ef187ba7cf..520c53b5e8 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@@ -277,10 -267,16 +277,16 @@@ start-point is either a local or remote Only list branches of the given object. --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 -------- diff --cc builtin/branch.c index 5fc57cdc98,39fa99bba7..af95ad2192 --- a/builtin/branch.c +++ b/builtin/branch.c @@@ -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"));