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

Re: the pager

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 27, 2013, 04:38 UTC
Message-ID
<xmqqd2ozhhob.fsf@gitster.dls.corp.google.com>
In-Reply-To
<201308261957.r7QJvfjF028935@freeze.ariadne.com>
worley@alum.mit.edu (Dale R. Worley) writes:
Show 13 quoted lines
> I've noticed that Git by default puts long output through "less" as a
> pager.  I don't like that, but this is not the time to change
> established behavior.  But while tracking that down, I noticed that
> the paging behavior is controlled by at least 5 things:
>
> the -p/--paginate/--no-pager options
> the GIT_PAGER environment variable
> the PAGER environment variable
> the core.pager Git configuration variable
> the build-in default (which seems to usually be "less")
> ...
> What is the (intended) order of precedence of specifiers of paging
> behavior?  My guess is that it should be the order I've given above.

I think that sounds about right (I didn't check the code, though). The most specific to the command line invocation (i.e. option) trumps the environment, which trumps the configured default, and the hard wired stuff is used as the fallback default.

I am not sure about PAGER environment and core.pager, though. People want Git specific pager that applies only to Git process specified to core.pager, and still want to use their own generic PAGER to other programs, so my gut feeling is that it would make sense to consider core.pager a way to specify GIT_PAGER without contaminating the environment, and use both to override the generic PAGER (in other words, core.pager should take precedence over PAGER as far as Git is concerned).

Previous: Dale R. WorleyNext: Dale R. Worley
Message 2 of 18 in “the pager”
  1. Dale R. WorleyAug 26, 2013
  2. Junio C HamanoAug 27, 2013
  3. Dale R. WorleyAug 28, 2013
  4. Junio C HamanoAug 28, 2013
  5. Dale R. WorleyAug 29, 2013
  6. Matthieu MoyAug 29, 2013
  7. Dale R. WorleySep 3, 2013
  8. Jonathan NiederSep 3, 2013
  9. pager: turn on "cat" optimization for DEFAULT_PAGERJeff King, Sep 3, 2013
  10. Junio C HamanoSep 3, 2013
  11. Erik Faye-LundNov 20, 2013
  12. Jeff KingNov 20, 2013
  13. Erik Faye-LundNov 20, 2013
  14. Junio C HamanoNov 20, 2013
  15. Erik Faye-LundNov 20, 2013
  16. Jeff KingSep 3, 2013
  17. Dale R. WorleySep 3, 2013
  18. Jeff KingSep 3, 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.