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

[PATCH] doc: add more examples of overriding LESS in core.pager

From
Todd Zullinger <tmz@pobox.com>
Date
Oct 2, 2026, 23:41 UTC
Message-ID
<20261002234203.4064847-1-tmz@pobox.com>
In-Reply-To
<20260919163725.TExDduTp@teonanacatl.net>

We set the LESS environment variable unconditionally which can surprise users of pagers which respect it but presume we'd only set LESS when `core.pager` calls less.

Provide examples of setting LESS in `core.pager` as an additional way to override the options we set in LESS.

Reported-by: Francisco Boni <boboniboni@gmail.com>
Signed-off-by: Todd Zullinger <tmz@pobox.com>
---
Now that 2.56.0 is out the door, I offer this up to see if
it feels like a useful improvement to the docs.

Cheers, Todd

 Documentation/config/core.adoc | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/Documentation/config/core.adoc b/Documentation/config/core.adoc
index 0b697f53f1..bdc74d291c 100644
--- a/Documentation/config/core.adoc
+++ b/Documentation/config/core.adoc
@@ -621,9 +621,17 @@ command to `LESS=FRX less -S`. The environment does not set the
 long lines. Similarly, setting `core.pager` to `less -+F` will
 deactivate the `F` option specified by the environment from the
 command-line, deactivating the "quit if one screen" behavior of
-`less`.  One can specifically activate some flags for particular
-commands: for example, setting `pager.blame` to `less -S` enables
-line truncation only for `git blame`.
+`less`.
++
+Another way to deactivate an option is prefixing `core.pager` with
+`LESS="RX"` to remove `-F` or `LESS=""` to override all options.
+This is useful if the `core.pager` command eventually runs `less` or
+a command which respects the `LESS` environment variable but lacks
+command line options to override `LESS` options.
++
+One can specifically activate some flags for particular commands: for
+example, setting `pager.blame` to `less -S` enables line truncation
+only for `git blame`.
 +
 Likewise, when the `LV` environment variable is unset, Git sets it
 to `-c`.  You can override this setting by exporting `LV` with
-- 
2.56.0
Previous: Todd ZullingerNext: brian m. carlson
Message 4 of 7 in “pager: consider revisiting automatic LESS=FRX with custom core.pager”
  1. Francisco BoniSep 19, 2026
  2. brian m. carlsonSep 19, 2026
  3. Todd ZullingerSep 19, 2026
  4. doc: add more examples of overriding LESS in core.pagerTodd Zullinger, Oct 2, 2026
  5. brian m. carlsonOct 5, 2026
  6. Junio C HamanoOct 6, 2026
  7. Francisco BoniSep 19, 2026

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.