strbuf_addf(out, " into %s\n", current_branch);
}
-static int do_fmt_merge_msg(int merge_summary, struct strbuf *in,
- struct strbuf *out) {
+static int do_fmt_merge_msg(int merge_title, int merge_summary,
+ struct strbuf *in, struct strbuf *out) {
int limit = 20, i = 0, pos = 0;
unsigned char head_sha1[20];
const char *current_branch;
if (!srcs.nr)
return 0;
- do_fmt_merge_msg_title(out, current_branch);
+ if (merge_title)
+ do_fmt_merge_msg_title(out, current_branch);
if (merge_summary) {
struct commit *head;
rev.ignore_merges = 1;
rev.limited = 1;
+ if (suffixcmp(out->buf, "\n"))
+ strbuf_addch(out, '\n');
+
for (i = 0; i < origins.nr; i++)
shortlog(origins.items[i].string, origins.items[i].util,
head, &rev, limit, out);
}
int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) {
- return do_fmt_merge_msg(merge_summary, in, out);
+ return do_fmt_merge_msg(1, merge_summary, in, out);
+}
+
+int fmt_merge_msg_shortlog(struct strbuf *in, struct strbuf *out) {
+ return do_fmt_merge_msg(0, 1, in, out);
}
int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)