From: Junio C Hamano Date: Mon, 28 Oct 2013 17:17:31 +0000 (-0700) Subject: Merge branch 'jk/shortlog-tolerate-broken-commit' into maint X-Git-Tag: v1.8.4.2~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/77bc4302dc93ac33891c72df59d9426eb6d06d0b?ds=inline;hp=-c Merge branch 'jk/shortlog-tolerate-broken-commit' into maint "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 --- 77bc4302dc93ac33891c72df59d9426eb6d06d0b diff --combined builtin/shortlog.c index 1434f8fee4,dca7fa1f91..84ffbb798e --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@@ -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; @@@ -137,7 -139,6 +139,7 @@@ 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) {