From: Linus Torvalds <torvalds@linux-foundation.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] shortlog: prompt when reading from terminal by mistake
Date: Thu, 8 Mar 2007 08:37:44 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0703080827170.10832@woody.linux-foundation.org> (raw)
In-Reply-To: <7vhcsw9h8p.fsf@assigned-by-dhcp.cox.net>
On Thu, 8 Mar 2007, Junio C Hamano wrote:
>
> Not so. "git shortlog" acts as a filter when no revs are given,
> unlike "git log" which defaults to HEAD. It was reading from
> its standard input.
Could we just change that?
There aren't *that* many users of "git shortlog", I bet, and I'm not sure
the "filter mode" is really worth it, especially since it ends up being
confusing once you get used to using it as just another "git log" variant.
It was a filter not really because people wanted a filter, but for
historical reasons, and because it wasn't really able to do things on its
own, and it was just an external script...
Yeah, as a filter it *can* stil lbe useful, of course, but I suspect the
usefullness is limited.
> + if (rev.pending.nr == 0) {
> + if (isatty(0))
> + fprintf(stderr, "(reading log to summarize from standard input)\n");
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.
So I think your patch is an improvement, but I suspect it would be a
bigger improvement to just make "git shortlog" work as "git log". If we
want to support the filtering mode, we could just make it be a separate
command ("git shortlog-filter") instead?
Linus
next prev parent reply other threads:[~2007-03-08 16:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-08 10:12 [PATCH] shortlog: prompt when reading from terminal by mistake Junio C Hamano
2007-03-08 13:04 ` Johannes Schindelin
2007-03-08 15:07 ` GSoC project mentors Shawn O. Pearce
2007-03-08 16:04 ` Alex Riesen
2007-03-09 0:59 ` Shawn O. Pearce
2007-03-09 9:50 ` Alex Riesen
2007-03-09 15:58 ` Shawn O. Pearce
2007-03-08 17:27 ` Johannes Schindelin
2007-03-09 2:26 ` Shawn O. Pearce
2007-03-08 16:37 ` Linus Torvalds [this message]
2007-03-08 17:10 ` [PATCH] shortlog: prompt when reading from terminal by mistake Johannes Schindelin
2007-03-08 17:19 ` Matthieu Moy
2007-03-08 17:28 ` Johannes Schindelin
2007-03-08 17:31 ` Linus Torvalds
2007-03-08 17:37 ` Johannes Schindelin
2007-03-09 14:41 ` Jakub Narebski
2007-03-10 0:39 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0703080827170.10832@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).