From: Todd Zullinger <tmz@pobox.com>
To: git@vger.kernel.org
Cc: Francisco Boni <boboniboni@gmail.com>,
"brian m. carlson" <sandals@crustytoothpaste.net>
Subject: [PATCH] doc: add more examples of overriding LESS in core.pager
Date: Fri, 2 Oct 2026 19:41:52 -0400 [thread overview]
Message-ID: <20261002234203.4064847-1-tmz@pobox.com> (raw)
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
next prev parent reply other threads:[~2026-10-02 23:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 12:19 pager: consider revisiting automatic LESS=FRX with custom core.pager Francisco Boni
2026-09-19 15:48 ` brian m. carlson
2026-09-19 16:37 ` Todd Zullinger
2026-10-02 23:41 ` Todd Zullinger [this message]
2026-10-05 23:59 ` [PATCH] doc: add more examples of overriding LESS in core.pager brian m. carlson
2026-10-06 16:01 ` Junio C Hamano
2026-09-19 16:52 ` pager: consider revisiting automatic LESS=FRX with custom core.pager Francisco Boni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261002234203.4064847-1-tmz@pobox.com \
--to=tmz@pobox.com \
--cc=boboniboni@gmail.com \
--cc=git@vger.kernel.org \
--cc=sandals@crustytoothpaste.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.