Web lists-archives.com

Re: "git branch" issue in 2.16.1




> On 07 Feb 2018, at 21:08, Jeff King <peff@xxxxxxxx> wrote:
> 
> On Wed, Feb 07, 2018 at 06:54:23PM +0100, Lars Schneider wrote:
> 
>>> Maybe the number of branches changed since then?
>>> As the pager only comes to life when the output fills
>>> more than your screen. Quick workarounds:
>>> * buy a bigger screen
>>> * have fewer branches.
>> 
>> Hmmm... there might be more to it. I just noticed the
>> pager behavior on macOS, too. Consider this call:
>> 
>> $ git diff --shortstat
>> 
>> This should generate at most one line of output. On Linux
>> the pager is never used. On macOS the pager is always used.
>> 
>> I tried older versions of Git on macOS and experienced the
>> same behavior.
> 
> Keep in mind that we always run the pager, since we don't know ahead of
> time how much output will be generated. It's just that with certain
> configurations of "less", it may exit if it sees EOF before there's a
> whole screen worth of data.
> 
> This is controlled by the "-F" option. By default, Git will set LESS=FRX
> in the environment if you do not already have a $LESS environment. So
> some other possibilities are:
> 
>  1. You have $LESS in your environment (without "F") on one platform
>     but not the other.

I think that's it. On my system LESS is defined to "-R".

This opens the pager:

	$ echo "TEST" | less

This does not open the pager:

	$ echo "TEST" | less -FRX

That means "F" works on macOS but Git doesn't set it because LESS is
already in my environment.

Question is, why is LESS set that way on my system? I can't find
it in .bashrc .bash_profile .zshrc and friends.

- Lars


> 
>  2. Git was built with a different PAGER_ENV Makefile variable on one
>     platform versus the other (that's what controls the baked-in LESS
>     defaults).
> 
>  3. "less" somehow behaves differently on macOS. The "F" behavior is
>     quite old, but possibly there's some platform-specific bug.
> 
> -Peff