Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] shortlog: prompt when reading from terminal by mistake

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:58

Linus Torvalds [off-list ref] writes:
Sure, this probably gets some cases (and the one you tried in particular), 
but if you pipe the output to a pager, I doubt it's actually all that 
useful.

To simulate a "wait a long time without output" case, try this:

	( echo "Important warning" >&2 ; sleep 10) | less -S

and at least for me, I don't see squat _in_case_I'm_at_the_top_ of the 
window, simply because "less" will clear the screen for me.
In other words, putting warnings on stderr usually isn't all that useful 
when you have something like a pager that will do tty stuff - it will 
easily overwrite the warning so quickly that you'll never see it at all.
That is correct in general, but you are being unfair.

You know git-shortlog has built-in pager _and_ you know _you_
added select(2) before spawning less, so that when that warning
is emitted, less hasn't even started running --- it cannot clear
the display.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help