From: Jonathan Nieder Date: Wed, 25 Sep 2013 06:29:00 +0000 (-0700) Subject: Merge branch 'jk/shortlog-tolerate-broken-commit' X-Git-Tag: v1.8.5-rc0~79 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7f794aab3eb84fedf1240c845976cab1c566c716?ds=inline;hp=-c Merge branch 'jk/shortlog-tolerate-broken-commit' * jk/shortlog-tolerate-broken-commit: shortlog: ignore commits with missing authors --- 7f794aab3eb84fedf1240c845976cab1c566c716 diff --combined builtin/shortlog.c index ae73d17b6c,dca7fa1f91..c226f767aa --- 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) { @@@ -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(),