[PATCH stable] pager: exec pager using /bin/sh -c

Martin Geisler mg at aragost.com
Fri May 21 07:16:57 CDT 2010


Augie Fackler <durin42 at gmail.com> writes:

> On May 21, 2010, at 7:04 AM, Martin Geisler wrote:
>
>> Brodie Rao <brodie at bitheap.org> writes:
>>
>>> # HG changeset patch
>>> # User Brodie Rao <brodie at bitheap.org>
>>> # Date 1274280852 18000
>>> # Branch stable
>>> # Node ID 9c655d72da80c45a843e213c247003860cb25f8b
>>> # Parent  b5c0f6a1143066c453032ab6dc4163ef52e932ee
>>> pager: exec pager using /bin/sh -c
>>>
>>> This mimics the behavior of popen() and ensures setting the pager to
>>> something like "LESS=FSRX less" will work.
>>
>> I don't understand why people would do that when they can just as well
>> use command line options, or they could export the LESS variable in
>> their shell startup file.
>
> Trouble is even using CLI options requires either splitting arguments
> (potentially dangerous, easy to screw up) or using system()/popen().
> The latter is an option, but the docs even suggested setting the pager
> to "LESS=FSRX less" IIRC.

Yeah, and I was looking at the docs and thinking "huh?" :-)

Maybe it's just me who has never considered setting an environment
option for something like this where a command line flag or shell alias
works just as well.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list