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

Re: [PATCH] git: fix paginate handling for commands with DELAY_PAGER_CONFIG

From
MBMatthew Bystrin <dev.mbstr@gmail.com>
Date
Nov 28, 2024, 22:27 UTC
Message-ID
<D5Y5Z3NCOYPB.1VT7HMAHZTOVE@gmail.com>
In-Reply-To
<CAN0heSqb+dzGAVnN6=_AkKa-qh4GYo7ku90No=uXBg2+wobL1Q@mail.gmail.com>
Martin Ågren wrote:
Show 9 quoted lines
> If `git add -p` is a long-running process that wants to repeatedly
> launch a pager, what could the opposite look like? A long-running
> process that wants to repeatedly launch an editor? While paging?
>
> Maybe `git rebase -i` could be one such example. TBH, running its output
> through a pager might not look super-pretty today due to it producing
> temporary output that it then erases, but at least it works. The editor
> might be graphical (or a script?) that won't actually suffer from the
> pager running. Killing the pager might be unwanted. So I don't know.
Agree, killing might be unwanted. Another approach proposed below.
> What is the original problem here? Is some kind of tooling issuing a
> `git -p tag -a` where it's not possible to teach it to drop the `-p`?
I faced such 'wrong' behaviour by typing commands manually.

It feels like one flag should not break execution of interactive commands like `git -p add -p`, `git -p rebase -i`, `git -p config -e` etc. I took into account Junio's comments, so please let me describe situation in more correct way. The following is related with workflow in terminal.

Currently when some interactive command is called with `--paginate` I see interfered output and cannot proceed to desirable actions. A good analogy is to call `vim | less`.

What I want to see is if we are calling interactive command with `--paginate` (1) it would rather fail explicitly with an error message, or (2) it would close+reopen/bypass pager when some interaction is needed. Bypassing pager is a complicated thing, I'm not sure it can be done (because of how they claim stdin)

Of course we can just simply do not use `-p` flag with interactive commands and provide some info in documentation.

Thanks!
Previous: Martin ÅgrenNext: Kristoffer Haugsbakk
Message 7 of 8 in “git: fix paginate handling for commands with DELAY_PAGER_CONFIG”
  1. git: fix paginate handling for commands with DELAY_PAGER_CONFIGMatthew Bystrin, Nov 20, 2024
  2. Martin ÅgrenNov 21, 2024
  3. Junio C HamanoNov 22, 2024
  4. Matthew BystrinNov 22, 2024
  5. Junio C HamanoNov 25, 2024
  6. Martin ÅgrenNov 25, 2024
  7. Matthew BystrinNov 28, 2024
  8. Kristoffer HaugsbakkNov 22, 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.