cmd_fetch_pack(): return early if finish_connect() fails
[gitweb.git] / builtin / fmt-merge-msg.c
index 4ee6a88d754c3a64dd562ae835779c7ee5c660e5..e2e27b2c404a1c451a20e396a7aa03dece722dad 100644 (file)
@@ -10,7 +10,7 @@
 #include "gpg-interface.h"
 
 static const char * const fmt_merge_msg_usage[] = {
-       "git fmt-merge-msg [-m <message>] [--log[=<n>]|--no-log] [--file <file>]",
+       N_("git fmt-merge-msg [-m <message>] [--log[=<n>]|--no-log] [--file <file>]"),
        NULL
 };
 
@@ -286,10 +286,10 @@ static void credit_people(struct strbuf *out,
        const char *me;
 
        if (kind == 'a') {
-               label = "\nBy ";
+               label = "\nBy ";
                me = git_author_info(IDENT_NO_DATE);
        } else {
-               label = "\nvia ";
+               label = "\n# Via ";
                me = git_committer_info(IDENT_NO_DATE);
        }
 
@@ -462,7 +462,10 @@ static void fmt_tag_signature(struct strbuf *tagbuf,
                strbuf_add(tagbuf, tag_body, buf + len - tag_body);
        }
        strbuf_complete_line(tagbuf);
-       strbuf_add_lines(tagbuf, "# ", sig->buf, sig->len);
+       if (sig->len) {
+               strbuf_addch(tagbuf, '\n');
+               strbuf_add_lines(tagbuf, "# ", sig->buf, sig->len);
+       }
 }
 
 static void fmt_merge_msg_sigs(struct strbuf *out)
@@ -627,8 +630,7 @@ int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
                rev.ignore_merges = 1;
                rev.limited = 1;
 
-               if (suffixcmp(out->buf, "\n"))
-                       strbuf_addch(out, '\n');
+               strbuf_complete_line(out);
 
                for (i = 0; i < origins.nr; i++)
                        shortlog(origins.items[i].string,
@@ -648,16 +650,16 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
        const char *message = NULL;
        int shortlog_len = -1;
        struct option options[] = {
-               { OPTION_INTEGER, 0, "log", &shortlog_len, "n",
-                 "populate log with at most <n> entries from shortlog",
+               { OPTION_INTEGER, 0, "log", &shortlog_len, N_("n"),
+                 N_("populate log with at most <n> entries from shortlog"),
                  PARSE_OPT_OPTARG, NULL, DEFAULT_MERGE_LOG_LEN },
-               { OPTION_INTEGER, 0, "summary", &shortlog_len, "n",
-                 "alias for --log (deprecated)",
+               { OPTION_INTEGER, 0, "summary", &shortlog_len, N_("n"),
+                 N_("alias for --log (deprecated)"),
                  PARSE_OPT_OPTARG | PARSE_OPT_HIDDEN, NULL,
                  DEFAULT_MERGE_LOG_LEN },
-               OPT_STRING('m', "message", &message, "text",
-                       "use <text> as start of message"),
-               OPT_FILENAME('F', "file", &inpath, "file to read from"),
+               OPT_STRING('m', "message", &message, N_("text"),
+                       N_("use <text> as start of message")),
+               OPT_FILENAME('F', "file", &inpath, N_("file to read from")),
                OPT_END()
        };