compat/poll: sleep 1 millisecond to avoid busy wait
[gitweb.git] / builtin / shortlog.c
index ae73d17b6cbc22f3a7eb30aff5a14cda27c5876c..4b7e53623fc9cf0c86ed0e7e87d4b3357d765d86 100644 (file)
@@ -65,7 +65,7 @@ static void insert_one_record(struct shortlog *log,
        eol = strchr(oneline, '\n');
        if (!eol)
                eol = oneline + strlen(oneline);
-       if (!prefixcmp(oneline, "[PATCH")) {
+       if (starts_with(oneline, "[PATCH")) {
                char *eob = strchr(oneline, ']');
                if (eob && (!eol || eob < eol))
                        oneline = eob + 1;
@@ -95,7 +95,7 @@ static void read_from_stdin(struct shortlog *log)
 
        while (fgets(author, sizeof(author), stdin) != NULL) {
                if (!(author[0] == 'A' || author[0] == 'a') ||
-                   prefixcmp(author + 1, "uthor: "))
+                   !starts_with(author + 1, "uthor: "))
                        continue;
                while (fgets(oneline, sizeof(oneline), stdin) &&
                       oneline[0] != '\n')
@@ -123,13 +123,15 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)
                else
                        eol++;
 
-               if (!prefixcmp(buffer, "author "))
+               if (starts_with(buffer, "author "))
                        author = buffer + 7;
                buffer = eol;
        }
-       if (!author)
-               die(_("Missing author: %s"),
+       if (!author) {
+               warning(_("Missing author: %s"),
                    sha1_to_hex(commit->object.sha1));
+               return;
+       }
        if (log->user_format) {
                struct pretty_print_context ctx = {0};
                ctx.fmt = CMIT_FMT_USERFORMAT;