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

Re: Cygwin + git log = no pager!

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
Feb 24, 2014, 19:34 UTC
Message-ID
<CAHd499BDBgaAZFkoc=S9i9hG=NifAmqhaW86fqgkzjShZd07ww@mail.gmail.com>
In-Reply-To
<20140224090618.GB10698@sigill.intra.peff.net>
On Mon, Feb 24, 2014 at 3:06 AM, Jeff King <peff@peff.net> wrote:
Show 46 quoted lines
> On Mon, Feb 24, 2014 at 08:55:41PM +1300, Chris Packham wrote:
>
>> > Thanks for the response. I did set this environment variable in my
>> > .bashrc like so:
>> >
>> > export GIT_PAGER=less
>> >
>> > However after I do a 'git log' it is just spitting it out all at once
>> > and not entering the pager.
>> >
>>
>> Um OK that was the obvious thing to try. There is also the config
>> variable core.pager but GIT_PAGER should take precedence.
>
> Presumably we are actually running what's in GIT_PAGER, but we can
> double-check with:
>
>   GIT_PAGER='echo custom pager' git log
>
> You can also try:
>
>   GIT_TRACE=1 git log
>
> which should describe the pager being run.
>
>> Could something be setting the environment variable LESS? Reading the
>> git-config man page for core.pager git wants to set LESS to FRSX but if
>> it is already set git takes that as an indication that you don't want to
>> set LESS automatically.
>
> We can also double-check the LESS setting in the executed pager:
>
>   GIT_PAGER='echo LESS=$LESS' git log
>
> If we are running less, and it is using FRSX, I'd suspect some kind of
> terminal weirdness with less itself. With "-F", less will quit if the
> whole output can be displayed; it's possible it thinks the screen is
> bigger than it is.
>
> Trying:
>
>   GIT_PAGER=less LESS=RSX git log
>
> might help.
>
> -Peff

So I set GIT_PAGER to 'echo custom pager' as you instructed, and I noticed that wasn't being printed when I ran my git log alias. So what I did after that was set GIT_TRACE=1 and here is the output I see before my logs start printing:

$ git lg trace: exec: 'git-lg' trace: run_command: 'git-lg' trace: run_command: 'git lg1' trace: exec: 'git-lg1' trace: run_command: 'git-lg1' trace: run_command: 'git short-log-base --branches --remotes --tags' trace: exec: 'git-short-log-base' '--branches' '--remotes' '--tags' trace: run_command: 'git-short-log-base' '--branches' '--remotes' '--tags' trace: alias expansion: short-log-base => 'log' '--graph' '--abbrev-commit' '--decorate' '--date=relative' '--format=format:%C(bold blue)%h%C(reset)%x09%C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim white)%an%C(reset) - %C(white)%s%C(reset)' trace: built-in: git 'log' '--graph' '--abbrev-commit' '--decorate' '--date=relative' '--format=format:%C(bold blue)%h%C(reset)%x09%C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim white)%an%C(reset) - %C(white)%s%C(reset)' '--branches' '--remotes' '--tags'

Does using an alias have something to do with this?
Previous: Jeff KingNext: Jeff King
Message 6 of 11 in “Cygwin + git log = no pager!”
  1. Robert DaileyFeb 22, 2014
  2. Chris PackhamFeb 22, 2014
  3. Robert DaileyFeb 23, 2014
  4. Chris PackhamFeb 24, 2014
  5. Jeff KingFeb 24, 2014
  6. Robert DaileyFeb 24, 2014
  7. Jeff KingFeb 26, 2014
  8. Robert DaileyFeb 26, 2014
  9. Robert DaileyFeb 26, 2014
  10. Jeff KingFeb 27, 2014
  11. Chris PackhamFeb 27, 2014

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.