Subject: Re: [PATCH RESEND] Do not override LESS

From: Anders Melchiorsen <[email-masked]>
Date: Sat, 23 Aug 2008 10:28:51 +0200

Junio C Hamano <[email-masked]> writes:

> Anders Melchiorsen <[email-masked]> writes:
>
>> Passing options to "less" with the LESS environment variable can
>> interfere with existing environment variables. There are at least two
>> problems, as the following examples show:
>>
>> 1. Alice is using git with colors. Now she decides to set LESS=i for
>> some reason. Suddenly, she sees codes in place of colors because LESS
>> is no longer set automatically.
>>
>> 2. Bob sets GIT_PAGER="less -RS", but does not set LESS. Git sets
>> LESS=FRSX before calling $GIT_PAGER. Now Bob wonders why his pager is
>> not always paging, when he explicitly tried to clear the F option.
>
> 3. Christ has been happily using git with his PAGER set to "less".  He
>    suddenly notices that output from git linewraps and the pager does not
>    exit when showing a short output, and gets very unhappy.

Well, I noted that point already, so I had hoped for a reply
explaining why it is a big problem. Maybe setting PAGER="less" is more
common than I think, as I have never seen it.

While I am wary of advocating a patch that makes Christ unhappy, the
"3." issue is easily fixed by him setting GIT_PAGER="less -FRSX".

My concern is that without reading the source, it can be confusing to
figure out what happens with less, $LESS and git. I think my patch
improves on that. On the other hand, predictability is not really
needed if the current setup DWIM. And maybe it does.

This is hardly a big issue either way, so now that I have response on
the patch, I will not pursue it further.

Thanks,
Anders.