Thread (17 messages) flat view 17 messages, 5 authors, 2016-08-03

Re: [PATCH 1/2] pager: move pager-specific setup into the build

From: Duy Nguyen <hidden>
Date: 2016-08-01 19:03:19

On Mon, Aug 1, 2016 at 7:52 PM, Jeff King [off-list ref] wrote:
On Mon, Aug 01, 2016 at 07:46:34PM +0200, Duy Nguyen wrote:
quoted
On Mon, Aug 1, 2016 at 3:05 AM, Eric Wong [off-list ref] wrote:
quoted
From: Junio C Hamano <redacted>

Allowing PAGER_ENV to be set at build-time allows us to move
pager-specific knowledge out of our build.  Currently, this
allows us to set a better default for FreeBSD where more(1)
is the same binary as less(1).
Nice. I was just too lazy to do something like this and "export
PAGER=less LESS=FRX" then ignored it :-P

Slightly off topic, but pagers like 'more' does not understand colors
either. But color.ui = auto does not know what and prints color code
anyway. It would be nice if we had some configuration to describe
"this pager can show colors, that pager does not" so I don't have to
maintain separate .gitconfig files on two platforms.
If you are interested, I suggest you read the thread linked earlier:

  https://public-inbox.org/git/52D87A79.6060600%40rawbw.com/T/#u

which discusses this and other issues. But basically, I think you cannot
really solve this without getting intimate with each pager (which people
seemed not to want to do).
Cooking pager specifics in git does sound bad. But it does not have to
be that way. What if we delegate the decision whether to color or not
to a script (e.g. by setting color.ui= "script <path to the script>")?
The script has all the info (env variables, uname, user preference...)
and can make a better decision than 'is stdout a tty?'. It's not about
out of the box experience, more towards customization (without
fragmenting .gitconfig files too much).
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help