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