diff options
author | Junio C Hamano <junkio@cox.net> | 2007-03-08 02:12:06 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-03-14 01:33:41 -0700 |
commit | 0497c620cae0531815afc4ada783b488eab3f447 (patch) | |
tree | de01b8eed6e9994651491c7452445a605255585e /builtin-shortlog.c | |
parent | 86952cdabdcc550a20794794db539c41877d17fc (diff) | |
download | git-0497c620cae0531815afc4ada783b488eab3f447.tar.gz |
shortlog: prompt when reading from terminal by mistake
I was trying to see who have been active recently to find GSoC
mentor candidates by running:
$ git shortlog -s -n --since=4.months | head -n 20
After waiting for about 20 seconds, I started getting worried,
thinking that the recent revision traversal updates might have
had an unintended side effect.
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.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-shortlog.c')
-rw-r--r-- | builtin-shortlog.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin-shortlog.c b/builtin-shortlog.c index 2d7726e8b9..29343aefc8 100644 --- a/builtin-shortlog.c +++ b/builtin-shortlog.c @@ -304,8 +304,11 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix) if (!access(".mailmap", R_OK)) read_mailmap(".mailmap"); - if (rev.pending.nr == 0) + if (rev.pending.nr == 0) { + if (isatty(0)) + fprintf(stderr, "(reading log to summarize from standard input)\n"); read_from_stdin(&list); + } else get_from_rev(&rev, &list); |