MsysGit: Why does git print empty lines of output?

It seems like inserting fewer blank lines, the closer I type the command at the bottom of the terminal window. If I print it at the top of the terminal window, it inserts the almost full window height of the empty lines; if I print it at the very bottom, empty lines will not be inserted into it.

It seems that the pager program outputs the output to the bottom of the terminal window, but I want the result to be directly under my command or at the top, like in Linux git.

I can expect the expected behavior using git --no-pager log , but what if I want to use a pager?

+3
source share
2 answers

Just add a few elements:

msysgit already discussed alternative consoles in question 29 a year ago (mid-2009: mintty , but only for cygwin, capturing window I / O ).

Problem 369 mentions the option “ git config pager.log off ” to disable paging for the “log”, which may come in handy for a specific scenario similar to the one mentioned by the OP.

A similar issue is being discussed right now (May 2010) in issue 484 (none other than SO user kusma , as he points out in the comments;))

I can reproduce this, but I do not think this is a problem with git. This is a pager; msys has some serious issues. Some experiments with lower rates show that the offender appears to be the -R flag:

 $ git --no-pager diff --color=always HEAD~1 TestSegmentedText.java | less -R 
+3
source

This is the behavior of the pager. By default, Git output is sent through paper, which behaves as you describe. (You could try to find another pager that acts the way you want, and use it as your pager.)

+1
source

All Articles