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

[RFC PATCH 1/1] git: ignore paginate for commands with DELAY_PAGER_CONFIG

From
MBMatthew Bystrin <dev.mbstr@gmail.com>
Date
Nov 4, 2024, 14:05 UTC
Message-ID
<20241104140536.4970-2-dev.mbstr@gmail.com>
In-Reply-To
<20241104140536.4970-1-dev.mbstr@gmail.com>

Calling commands using editor in terminal with `--paginate` option break things. For example `git --paginate config --edit`. Add extra check to ignore paginate flag in case command have DELAY_PAGER_CONFIG set.

Signed-off-by: Matthew Bystrin <dev.mbstr@gmail.com>
---
 git.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/git.c b/git.c
index c2c1b8e22c..2b3b049f4a 100644
--- a/git.c
+++ b/git.c
@@ -464,11 +464,12 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv, struct
 	}
 	assert(!prefix || *prefix);
 	precompose_argv_prefix(argc, argv, NULL);
-	if (use_pager == -1 && run_setup &&
-		!(p->option & DELAY_PAGER_CONFIG))
+	if (use_pager == -1 && run_setup && !(p->option & DELAY_PAGER_CONFIG))
 		use_pager = check_pager_config(p->cmd);
 	if (use_pager == -1 && p->option & USE_PAGER)
 		use_pager = 1;
+	if (use_pager == 1 && (p->option & DELAY_PAGER_CONFIG))
+		use_pager = 0;
 	if (run_setup && startup_info->have_repository)
 		/* get_git_dir() may set up repo, avoid that */
 		trace_repo_setup();
-- 
2.43.0
Previous: Matthew Bystrin
Message 2 of 2 in “git: pager behaviour”
  1. 0/1 git: pager behaviourMatthew Bystrin, Nov 4, 2024
  2. 1/1 git: ignore paginate for commands with DELAY_PAGER_CONFIGMatthew Bystrin, Nov 4, 2024

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.