git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] shortlog: prompt when reading from terminal by mistake
@ 2007-03-08 10:12 Junio C Hamano
  2007-03-08 13:04 ` Johannes Schindelin
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Junio C Hamano @ 2007-03-08 10:12 UTC (permalink / raw)
  To: git

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>
---

   Arguably because --since=4.months clearly states I am
   expecting it to start digging from somewhere, it would be
   more sensible to default to HEAD in this case.  I suspect it
   might be as simple as checking argc before we call
   setup_revisions() and pass "HEAD" as the default parameter to
   it, but it is getting late here.

 builtin-shortlog.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index 2d7726e..29343ae 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);
 

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2007-03-10  0:39 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH] shortlog: prompt when reading from terminal by mistake Linus Torvalds
2007-03-08 17:10   ` 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

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).