summaryrefslogtreecommitdiff
path: root/builtin/fmt-merge-msg.c
diff options
context:
space:
mode:
authorTay Ray Chuan <rctay89@gmail.com>2010-05-10 17:17:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-05-10 19:02:14 (GMT)
commit8c6bdfdf8ba9a3d7a03d64b7a98305a460921130 (patch)
tree4678d1a8426af72edbebc8430ab487a15e5f1575 /builtin/fmt-merge-msg.c
parent403994e83dd3ad2424f0b3084c8dc4fd1ca6374a (diff)
downloadgit-8c6bdfdf8ba9a3d7a03d64b7a98305a460921130.zip
git-8c6bdfdf8ba9a3d7a03d64b7a98305a460921130.tar.gz
git-8c6bdfdf8ba9a3d7a03d64b7a98305a460921130.tar.bz2
fmt-merge-msg: add function to append shortlog only
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fmt-merge-msg.c')
-rw-r--r--builtin/fmt-merge-msg.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index d0160cb..48548cf 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -255,8 +255,8 @@ static void do_fmt_merge_msg_title(struct strbuf *out,
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;
@@ -285,7 +285,8 @@ static int do_fmt_merge_msg(int merge_summary, struct strbuf *in,
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;
@@ -305,7 +306,11 @@ static int do_fmt_merge_msg(int merge_summary, struct strbuf *in,
}
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)