git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH RFC] show-branch: use pager

From
Øystein Walle <oystwa@gmail.com>
Date
Jun 13, 2013, 06:43 UTC
Message-ID
<1371105811-3112-1-git-send-email-oystwa@gmail.com>
This is for consistency with other porcelain commands such as 'log'.
Signed-off-by: Øystein Walle <oystwa@gmail.com>
---
The rationale for this patch I hope is consicely explained in the commit
message. I was rather surprised it didn't use a pager as I've gotten used to it
for most commands.

I marked this as an RFC because of Jeff King's comments in daa0c3d97 where I got the impression this this might not be a good idea. However I haven't found any bugs and all the tests pass. It is more a huble suggestion than anything but I thought I might as well send it as a patch.

setup_pager() is already pulled in via cache.h so there was no need to add any #include directive. I suppose this is as close to a one-liner as it gets :)

Best regards, Øsse

 builtin/show-branch.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 90fc6b1..bd3e10c 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -683,6 +683,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
 	};
 
 	git_config(git_show_branch_config, NULL);
+	setup_pager();
 
 	/* If nothing is specified, try the default first */
 	if (ac == 1 && default_num) {
-- 
1.8.2.2
Next: Jeff King
Message 1 of 5 in “show-branch: use pager”
  1. show-branch: use pagerØystein Walle, Jun 13, 2013
  2. Jeff KingJun 13, 2013
  3. show-branch: use pagerØystein Walle, Jun 13, 2013
  4. Matthieu MoyJun 13, 2013
  5. Junio C HamanoJun 13, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.