4 ms·
And yet .. programs are not just for composition. They have to behave sensibly for people. I love that 'git log' outputs in a pager. 'svn log' by comparison is
by emmelaich 12y ago
And yet .. programs are not just for composition.
They have to behave sensibly for people.
I love that 'git log' outputs in a pager.
'svn log' by comparison is nuts.
- aidos 12y agoThat's an interesting case. Should it not just output to stdout and you have to pipe it to less? If you wanted it to always pipe to less you could just set up an alias for it.
- kec 12y agoThe git diff and log commands are primarily intended for human consumption. I'm not the one you were relying to, but I think it makes sense that git defaults to make that consumption easier, even if it isn't strictly "Unix". (You can also disable this behavior and get a more Unix-y interface by default via gitconfig or on a case by case basis with --no-pager).
- aidos 12y agoFor sure, and in fact, I very happy with the current behaviour. I guess the pager is a case where it doesn't matter much if it's included or not since I guess it doesn't get in the way if you pipe to something else. Does it consume extra resources? git log | wc vs git log --no-pager | wc I'm sure it's neither here nor there in practice. More of a hypothetical question.
- pjc50 12y agoI've just realised that the best solution to this (which I've never seen) is for the shell or terminal emulator to capture long output into a pager for you once it exceeds a certain length.
- dkuntz2 12y agoI think there may be some flags in pagers to do this for you, but I can't remember for sure.
- emmelaich 12y agoI believe software should be written to to satisfy the common case and the common case is the non-expert.
- stsp 12y agoI like the default pager in 'git log', too. Some work has been done on the svn side: http://svn.apache.org/repos/asf/subversion/branches/automatic-pager/BRANCH-README http://svn.apache.org/repos/asf/subversion/branches/automati... However, it's not on trunk yet because it's hard to find good defaults. An automatic pager makes sense for some commands, but not all -- and in a meritocratic development model this kind of thing can cause an endless discussion... I suspect we'll eventually merge the feature in a disabled by default state and allow users to enable it on a per-command basis. Git's hard-coding of options passed to the pager has problems, too: https://mail-archives.apache.org/mod_mbox/subversion-dev/201402.mbox/%3C20140204151506.GJ24105@tarsus.local2%3E https://mail-archives.apache.org/mod_mbox/subversion-dev/201...