]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-shortlog.c
Merge branch 'mw/send-email'
[git.git] / builtin-shortlog.c
index 90666cbd78732c15566fa8050e666999615b8354..fa8bc7d02a2268d99dcc829cb3adbee10c949306 100644 (file)
@@ -8,7 +8,7 @@
 #include "mailmap.h"
 
 static const char shortlog_usage[] =
-"git-shortlog [-n] [-s] [<commit-id>... ]";
+"git-shortlog [-n] [-s] [-e] [<commit-id>... ]";
 
 static char *common_repo_prefix;
 static int email;
@@ -249,9 +249,10 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
 
        read_mailmap(&mailmap, ".mailmap", &common_repo_prefix);
 
+       /* assume HEAD if from a tty */
+       if (!rev.pending.nr && isatty(0))
+               add_head_to_pending(&rev);
        if (rev.pending.nr == 0) {
-               if (isatty(0))
-                       fprintf(stderr, "(reading log to summarize from standard input)\n");
                read_from_stdin(&list);
        }
        else