cmd_fetch_pack(): return early if finish_connect() fails
[gitweb.git] / builtin / shortlog.c
index f5efc67c9cad24fe54d5c6ab7257d38a4b1727ac..b316cf37ca768f1502c5d0cfa64372a9b322a572 100644 (file)
@@ -10,9 +10,9 @@
 #include "parse-options.h"
 
 static char const * const shortlog_usage[] = {
-       "git shortlog [-n] [-s] [-e] [-w] [rev-opts] [--] [<commit-id>... ]",
+       N_("git shortlog [-n] [-s] [-e] [-w] [rev-opts] [--] [<commit-id>... ]"),
        "",
-       "[rev-opts] are documented in git-rev-list(1)",
+       N_("[rev-opts] are documented in git-rev-list(1)"),
        NULL
 };
 
@@ -29,9 +29,6 @@ static int compare_by_number(const void *a1, const void *a2)
                return -1;
 }
 
-const char *format_subject(struct strbuf *sb, const char *msg,
-                          const char *line_separator);
-
 static void insert_one_record(struct shortlog *log,
                              const char *author,
                              const char *oneline)
@@ -141,9 +138,8 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)
        const char *author = NULL, *buffer;
        struct strbuf buf = STRBUF_INIT;
        struct strbuf ufbuf = STRBUF_INIT;
-       struct pretty_print_context ctx = {0};
 
-       pretty_print_commit(CMIT_FMT_RAW, commit, &buf, &ctx);
+       pp_commit_easy(CMIT_FMT_RAW, commit, &buf);
        buffer = buf.buf;
        while (*buffer && *buffer != '\n') {
                const char *eol = strchr(buffer, '\n');
@@ -162,11 +158,12 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)
                    sha1_to_hex(commit->object.sha1));
        if (log->user_format) {
                struct pretty_print_context ctx = {0};
+               ctx.fmt = CMIT_FMT_USERFORMAT;
                ctx.abbrev = log->abbrev;
                ctx.subject = "";
                ctx.after_subject = "";
                ctx.date_mode = DATE_NORMAL;
-               pretty_print_commit(CMIT_FMT_USERFORMAT, commit, &ufbuf, &ctx);
+               pretty_print_commit(&ctx, commit, &ufbuf);
                buffer = ufbuf.buf;
        } else if (*buffer) {
                buffer++;
@@ -253,13 +250,13 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
 
        static const struct option options[] = {
                OPT_BOOLEAN('n', "numbered", &log.sort_by_number,
-                           "sort output according to the number of commits per author"),
+                           N_("sort output according to the number of commits per author")),
                OPT_BOOLEAN('s', "summary", &log.summary,
-                           "Suppress commit descriptions, only provides commit count"),
+                           N_("Suppress commit descriptions, only provides commit count")),
                OPT_BOOLEAN('e', "email", &log.email,
-                           "Show the email address of each author"),
-               { OPTION_CALLBACK, 'w', NULL, &log, "w[,i1[,i2]]",
-                       "Linewrap output", PARSE_OPT_OPTARG, &parse_wrap_args },
+                           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(),
        };