Merge branch 'jk/shortlog-tolerate-broken-commit'
authorJonathan Nieder <jrnieder@gmail.com>
Wed, 25 Sep 2013 06:29:00 +0000 (23:29 -0700)
committerJonathan Nieder <jrnieder@gmail.com>
Wed, 25 Sep 2013 06:29:00 +0000 (23:29 -0700)
* jk/shortlog-tolerate-broken-commit:
shortlog: ignore commits with missing authors

1  2 
builtin/shortlog.c
diff --combined builtin/shortlog.c
index ae73d17b6cbc22f3a7eb30aff5a14cda27c5876c,dca7fa1f91cecacba9e09dff9875260f08a79386..c226f767aa9b0e5633a3d5dde7b0b969fec39c7f
@@@ -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) {
@@@ -224,12 -225,12 +226,12 @@@ int cmd_shortlog(int argc, const char *
        int nongit = !startup_info->have_repository;
  
        static const struct option options[] = {
 -              OPT_BOOLEAN('n', "numbered", &log.sort_by_number,
 -                          N_("sort output according to the number of commits per author")),
 -              OPT_BOOLEAN('s', "summary", &log.summary,
 -                          N_("Suppress commit descriptions, only provides commit count")),
 -              OPT_BOOLEAN('e', "email", &log.email,
 -                          N_("Show the email address of each author")),
 +              OPT_BOOL('n', "numbered", &log.sort_by_number,
 +                       N_("sort output according to the number of commits per author")),
 +              OPT_BOOL('s', "summary", &log.summary,
 +                       N_("Suppress commit descriptions, only provides commit count")),
 +              OPT_BOOL('e', "email", &log.email,
 +                       N_("Show the email address of each author")),
                { OPTION_CALLBACK, 'w', NULL, &log, N_("w[,i1[,i2]]"),
                        N_("Linewrap output"), PARSE_OPT_OPTARG, &parse_wrap_args },
                OPT_END(),