X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-shortlog.c;h=29343aefc843c4dd22095f559262bc6b5e381440;hb=40250af411f33afa0c39a5d461829b676453ce3b;hp=2f71a2a6e2ecf556956a0271d8af9ad852d5a93c;hpb=2c7ca1fcf19d3803a225130491e26dca86d1781d;p=git.git diff --git a/builtin-shortlog.c b/builtin-shortlog.c index 2f71a2a6e..29343aefc 100644 --- a/builtin-shortlog.c +++ b/builtin-shortlog.c @@ -217,13 +217,13 @@ static void get_from_rev(struct rev_info *rev, struct path_list *list) prepare_revision_walk(rev); while ((commit = get_revision(rev)) != NULL) { - char *author = NULL, *oneline, *buffer; + const char *author = NULL, *oneline, *buffer; int authorlen = authorlen, onelinelen; /* get author and oneline */ for (buffer = commit->buffer; buffer && *buffer != '\0' && *buffer != '\n'; ) { - char *eol = strchr(buffer, '\n'); + const char *eol = strchr(buffer, '\n'); if (eol == NULL) eol = buffer + strlen(buffer); @@ -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);