From: Todd Zullinger Date: Fri, 02 Oct 2026 23:41:52 GMT Subject: [PATCH] doc: add more examples of overriding LESS in core.pager 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 Signed-off-by: Todd Zullinger --- 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