From: Michele Ballabio Date: Wed, 24 Feb 2010 20:49:03 +0000 (+0100) Subject: shortlog: warn the user when there is no input X-Git-Tag: v1.7.1-rc0~85^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3731449591130b2f5ca7257c46721785a6340a18;p=git.git shortlog: warn the user when there is no input A simple "git shortlog" outside of a git repository stalls waiting for an input. Check if that's the case by testing with isatty() before read_from_stdin(), and warn the user like "git commit" does in a similar case. Signed-off-by: Michele Ballabio Signed-off-by: Junio C Hamano --- diff --git a/builtin-shortlog.c b/builtin-shortlog.c index b3b055f68..22668b4d3 100644 --- a/builtin-shortlog.c +++ b/builtin-shortlog.c @@ -295,6 +295,8 @@ parse_done: if (!nongit && !rev.pending.nr && isatty(0)) add_head_to_pending(&rev); if (rev.pending.nr == 0) { + if (isatty(0)) + fprintf(stderr, "(reading log message from standard input)\n"); read_from_stdin(&log); } else