From d74b541e0b40be0bf35e836bd8c6cbf653283d4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C3=85gren?= Date: Sun, 19 Nov 2017 16:03:49 +0100 Subject: branch: respect `pager.branch` in list-mode only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar to de121ffe5 (tag: respect `pager.tag` in list-mode only, 2017-08-02), use the DELAY_PAGER_CONFIG-mechanism to only respect `pager.branch` when we are listing branches. We have two possibilities of generalizing what that earlier commit made to `git tag`. One is to interpret, e.g., --set-upstream-to as "it does not use an editor, so we should page". Another, the one taken by this commit, is to say "it does not list, so let's not page". That is in line with the approach of the series on `pager.tag` and in particular the wording in Documentation/git-tag.txt, which this commit reuses for git-branch.txt. This fixes the failing test added in the previous commit. Also adapt the test for whether `git branch --set-upstream-to` respects `pager.branch`. Signed-off-by: Martin Ågren Signed-off-by: Junio C Hamano --- builtin/branch.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'builtin/branch.c') diff --git a/builtin/branch.c b/builtin/branch.c index 8a0595e11..3eb31cd1e 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -648,6 +648,9 @@ int cmd_branch(int argc, const char **argv, const char *prefix) rename *= 2; } + if (list) + setup_auto_pager("branch", 0); + if (delete) { if (!argc) die(_("branch name required")); -- cgit v1.2.1 From 0ae19de74f6f5d6c6f9c80899e1ecd611c5b9827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C3=85gren?= Date: Sun, 19 Nov 2017 16:03:50 +0100 Subject: branch: change default of `pager.branch` to "on" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- builtin/branch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin/branch.c') diff --git a/builtin/branch.c b/builtin/branch.c index 3eb31cd1e..39fa99bba 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -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) -- cgit v1.2.1