From c7860da7db9e9a9ce462bf511b36c5b21b544cbf Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Fri, 2 Oct 2026 19:41:52 -0400 Subject: [PATCH] doc: add more examples of overriding LESS in core.pager 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 Signed-off-by: Junio C Hamano --- 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 a0ebf03e2e..2cee57ce85 100644 --- a/Documentation/config/core.adoc +++ b/Documentation/config/core.adoc @@ -606,9 +606,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