Git development
 help / color / mirror / Atom feed
From: Todd Zullinger <tmz@pobox.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: Francisco Boni <boboniboni@gmail.com>, git@vger.kernel.org
Subject: Re: pager: consider revisiting automatic LESS=FRX with custom core.pager
Date: Sat, 19 Sep 2026 12:37:33 -0400	[thread overview]
Message-ID: <20260919163725.TExDduTp@teonanacatl.net> (raw)
In-Reply-To: <aq6utXAQA-rRoKSm@fruit.crustytoothpaste.net>

[-- Attachment #1: Type: text/plain, Size: 2766 bytes --]

brian m. carlson wrote:
> I agree that this can cause unusual behaviour in the case you've
> described, but that's more of the case because it's actually unusual to
> have commands that take arguments through the environment in this way.
> That's no longer really considered a good design; normally we use a
> config file instead these days.
> 
> I'll note that it is configurable both through the environment and
> through configuration, using one of the following:
> 
>     GIT_PAGER='LESS="" delta'
> 
> or:
> 
>     git config core.pager 'LESS="" delta'
> 
> or, if you prefer to be still more conservative:
> 
>     GIT_PAGER='env -i PATH="$PATH" delta'
> 
> which unsets all environment variables but the path for your pager.
> 
>> So this is not primarily a request for a workaround; rather, I wanted
>> to raise the broader behavior because the interaction with pager
>> wrappers is quite surprising and difficult to diagnose.
> 
> I think at this point, we're unlikely to change the behaviour and it
> would be a notable and unwelcome change to do so.

All good points.  I wonder if it would help to add a couple
of sentences to the core.pager documentation mentioning the
method of setting `LESS=""` as another way to override the
options?  Something like:

  diff --git i/Documentation/config/core.adoc w/Documentation/config/core.adoc
  index 340329edc3..45e1fda2a2 100644
  --- i/Documentation/config/core.adoc
  +++ w/Documentation/config/core.adoc
  @@ -614,9 +614,15 @@ 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 setting `core.pager`
  +to `LESS="RX" less` or `LESS="" less` to override all options. The
  +second form 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

I don't know if that adds more value than the cost of
increasing the verbiage of an already long document.

-- 
Todd

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-09-19 16:37 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 [this message]
2026-10-02 23:41     ` [PATCH] doc: add more examples of overriding LESS in core.pager Todd Zullinger
2026-10-05 23:59       ` 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=20260919163725.TExDduTp@teonanacatl.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox