git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: "git branch" issue in 2.16.1

From
Lars Schneider <larsxschneider@gmail.com>
Date
Feb 7, 2018, 22:20 UTC
Message-ID
<F7E12F8B-6C55-4348-860A-B91942922A73@gmail.com>
In-Reply-To
<20180207200859.GA9141@sigill.intra.peff.net>
Show 32 quoted lines
> On 07 Feb 2018, at 21:08, Jeff King <peff@peff.net> 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
Show 9 quoted lines
> 
>  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
Previous: Junio C HamanoNext: Jeff King
Message 9 of 15 in “"git branch" issue in 2.16.1”
  1. Jason RaceyFeb 6, 2018
  2. Todd ZullingerFeb 6, 2018
  3. Stefan BellerFeb 6, 2018
  4. Lars SchneiderFeb 7, 2018
  5. Jason RaceyFeb 7, 2018
  6. Lars SchneiderFeb 7, 2018
  7. Jeff KingFeb 7, 2018
  8. Junio C HamanoFeb 7, 2018
  9. Lars SchneiderFeb 7, 2018
  10. Jeff KingFeb 8, 2018
  11. Lars SchneiderFeb 8, 2018
  12. Lars SchneiderFeb 8, 2018
  13. Kevin DaudtFeb 8, 2018
  14. Lars SchneiderFeb 8, 2018
  15. Paul SmithFeb 6, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.