summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Michele Ballabio <barra_cuda@katamail.com>2010-02-24 21:49:03 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-02-24 12:59:09 -0800
commit3731449591130b2f5ca7257c46721785a6340a18 (patch)
tree870eecb5cd1caed3b81d8a911e6cdb92959001b6
parentGit 1.7.0 (diff)
downloadtgif-3731449591130b2f5ca7257c46721785a6340a18.tar.xz
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 <barra_cuda@katamail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin-shortlog.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index b3b055f68c..22668b4d3d 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