mirror of
https://github.com/git/git
synced 2024-11-05 18:59:29 +00:00
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>
This commit is contained in:
parent
86952cdabd
commit
0497c620ca
1 changed files with 4 additions and 1 deletions
|
@ -304,8 +304,11 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
|
||||||
if (!access(".mailmap", R_OK))
|
if (!access(".mailmap", R_OK))
|
||||||
read_mailmap(".mailmap");
|
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);
|
read_from_stdin(&list);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
get_from_rev(&rev, &list);
|
get_from_rev(&rev, &list);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue