Merge branch 'jk/shortlog-tolerate-broken-commit' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 28 Oct 2013 17:17:31 +0000 (10:17 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Oct 2013 17:17:31 +0000 (10:17 -0700)
"git shortlog" used to choke and die when there is a malformed commit
(e.g. missing authors); it now simply ignore such a commit and keeps
going.

* jk/shortlog-tolerate-broken-commit:
shortlog: ignore commits with missing authors

1  2 
builtin/shortlog.c
diff --combined builtin/shortlog.c
index 1434f8fee487751abe069250c611bdaed2fa5857,dca7fa1f91cecacba9e09dff9875260f08a79386..84ffbb798e2e0ec8c1121790c04ccbb58b05e591
@@@ -127,9 -127,11 +127,11 @@@ void shortlog_add_commit(struct shortlo
                        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;
                ctx.subject = "";
                ctx.after_subject = "";
                ctx.date_mode = DATE_NORMAL;
 +              ctx.output_encoding = get_log_output_encoding();
                pretty_print_commit(&ctx, commit, &ufbuf);
                buffer = ufbuf.buf;
        } else if (*buffer) {