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

Re: Forcing git to use a pager without a tty

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 29, 2021, 06:09 UTC
Message-ID
<xmqqlf6tyzfy.fsf@gitster.g>
In-Reply-To
<87pmwazygf.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> What do you do about things like "git status" etc. that produce a lot of
> output, but don't invoke the pager even then (but perhaps should), ditto
> for all the plumbing or plumbing-like such as "ls-files", "ls-tree" etc?
I am puzzled.  Doesn't "git -p status" force spawning the pager?
    ... goes and checks ...

Ahh, OK, -p does force us to try to see if pager is warranted, and then we decide it is not because the output is not sent to the tty.

This behaviour makes sense if we are truly driving a pager via GIT_PAGER, but I agree with you that it probably is inconvenient if you are abusing the GIT_PAGER mechanism to drive something that is not about paging output but about grabbing the output and post-processing it.

Previous: Avishay Matayev
Message 13 of 13 in “”
  1. Avishay MatayevJun 22, 2021
  2. Felipe ContrerasJun 23, 2021
  3. Avishay MatayevJun 23, 2021
  4. Felipe ContrerasJun 25, 2021
  5. Avishay MatayevJun 26, 2021
  6. Why empty subject? (was Re: )Bagas Sanjaya, Jun 23, 2021
  7. Avishay MatayevJun 23, 2021
  8. Phillip WoodJun 23, 2021
  9. Phillip WoodJun 23, 2021
  10. Avishay MatayevJun 24, 2021
  11. Ævar Arnfjörð BjarmasonJun 24, 2021
  12. Avishay MatayevJun 26, 2021
  13. Junio C HamanoJun 29, 2021

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.