开发者

msysGit: Why does git log output blank lines?

It appears to insert less blank lines the closer I type the command to the bottom of the terminal window. If I type it at the top of the terminal window, it inserts nearly a full window height of blank lines; if I type it at the very bottom, no blank lines are inserted.

It seems like the pager program is pushing output to the bottom of the terminal window, but I want the output to be right below my command or at the top, like in Linux git.

I can get expected behavior by using git --no-pa开发者_如何学Cger log, but what if I want to use a pager?


Just to add a few elements:

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

The issue 369 mentions the option "git config pager.log off" to disable paging for "log", which can come in handy for certain scenario similar to the one the OP mentions.

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

I can reproduce this, but I don't think it's an issue with git itself. It's the pager; less on msys has some serious issues. Some experiments with less shows that the culprit seems to be the -R flag:

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


That's the behavior of the pager. By default, Git output is piped through a paper that behaves the way you describe. (You could try to find another pager that acts like you want, and use that as your pager instead.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜