{"thread":{"id":"62443","subject":"[RFC PATCH 0/1] git: pager behaviour","startedAt":"2024-11-04T14:05:41Z","lastAt":"2024-11-04T14:05:42Z","messageCount":2,"participants":["Matthew Bystrin"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"506527","messageId":"20241104140536.4970-1-dev.mbstr@gmail.com","threadId":"62443","inReplyTo":null,"subject":"[RFC PATCH 0/1] git: pager behaviour","fromName":"Matthew Bystrin","fromEmail":"dev.mbstr@gmail.com","sentAt":"2024-11-04T14:05:35Z","receivedAt":"2024-11-04T14:05:41Z","isPatch":true,"sender":{"key":"dev.mbstr@gmail.com","avatar":null},"body":"I've recently discovered that launching `--edit` with `--paginate` breaks\neverything. Is this an expected behaviour? I proposed a possible solution in\nthis patch. However it is turned out that situation with pager is more\ncomplicated than expected.\n\nThis patch does not fix `notes` command and even does not pass \"t7006.24 git tag\n-a respects --paginate\" test. Interesting point to mention is that `notes edit`\ncommand can be also broken with `-c pager.notes=1`.\n\nRelates: cd878a206e8c (t7006: add tests for how git config paginates) \n\nMatthew Bystrin (1):\n  git: ignore paginate for commands with DELAY_PAGER_CONFIG\n\n git.c | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\n-- \n2.43.0\n\n"},{"id":"506528","messageId":"20241104140536.4970-2-dev.mbstr@gmail.com","threadId":"62443","inReplyTo":"20241104140536.4970-1-dev.mbstr@gmail.com","subject":"[RFC PATCH 1/1] git: ignore paginate for commands with DELAY_PAGER_CONFIG","fromName":"Matthew Bystrin","fromEmail":"dev.mbstr@gmail.com","sentAt":"2024-11-04T14:05:36Z","receivedAt":"2024-11-04T14:05:42Z","isPatch":true,"sender":{"key":"dev.mbstr@gmail.com","avatar":null},"body":"Calling commands using editor in terminal with `--paginate` option break\nthings. For example `git --paginate config --edit`. Add extra check to\nignore paginate flag in case command have DELAY_PAGER_CONFIG set.\n\nSigned-off-by: Matthew Bystrin <dev.mbstr@gmail.com>\n---\n git.c | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/git.c b/git.c\nindex c2c1b8e22c..2b3b049f4a 100644\n--- a/git.c\n+++ b/git.c\n@@ -464,11 +464,12 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv, struct\n \t}\n \tassert(!prefix || *prefix);\n \tprecompose_argv_prefix(argc, argv, NULL);\n-\tif (use_pager == -1 && run_setup &&\n-\t\t!(p->option & DELAY_PAGER_CONFIG))\n+\tif (use_pager == -1 && run_setup && !(p->option & DELAY_PAGER_CONFIG))\n \t\tuse_pager = check_pager_config(p->cmd);\n \tif (use_pager == -1 && p->option & USE_PAGER)\n \t\tuse_pager = 1;\n+\tif (use_pager == 1 && (p->option & DELAY_PAGER_CONFIG))\n+\t\tuse_pager = 0;\n \tif (run_setup && startup_info->have_repository)\n \t\t/* get_git_dir() may set up repo, avoid that */\n \t\ttrace_repo_setup();\n-- \n2.43.0\n\n"}]}