git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 7/8] fmt-merge-msg: add function to append shortlog only

From
Tay Ray Chuan <rctay89@gmail.com>
Date
May 10, 2010, 17:17 UTC
Message-ID
<1273511872-4924-8-git-send-email-rctay89@gmail.com>
In-Reply-To
<1273511872-4924-1-git-send-email-rctay89@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 builtin.h               |    1 +
 builtin/fmt-merge-msg.c |   13 +++++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/builtin.h b/builtin.h
index 5c887ef..b614d12 100644
--- a/builtin.h
+++ b/builtin.h
@@ -16,6 +16,7 @@ extern const char *help_unknown_cmd(const char *cmd);
 extern void prune_packed_objects(int);
 extern int fmt_merge_msg(int merge_summary, struct strbuf *in,
 	struct strbuf *out);
+extern int fmt_merge_msg_shortlog(struct strbuf *in, struct strbuf *out);
 extern int commit_notes(struct notes_tree *t, const char *msg);
 
 struct notes_rewrite_cfg {
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)
-- 
1.7.1.189.g07419
Previous: Tay Ray ChuanNext: Tay Ray Chuan
Message 8 of 9 in “merge: allow --log to append shortlog to -m”
  1. 0/8 merge: allow --log to append shortlog to -mTay Ray Chuan, May 10, 2010
  2. 1/8 t7604-merge-custom-message: shift expected output creationTay Ray Chuan, May 10, 2010
  3. 2/8 t7604-merge-custom-message: show that --log doesn't append to -mTay Ray Chuan, May 10, 2010
  4. 3/8 merge: update commentTay Ray Chuan, May 10, 2010
  5. 4/8 merge: rename variableTay Ray Chuan, May 10, 2010
  6. 5/8 fmt-merge-msg: minor refactor of fmt_merge_msg()Tay Ray Chuan, May 10, 2010
  7. 6/8 fmt-merge-msg: refactor merge title formattingTay Ray Chuan, May 10, 2010
  8. 7/8 fmt-merge-msg: add function to append shortlog onlyTay Ray Chuan, May 10, 2010
  9. 8/8 merge: --log appends shortlog to message if specifiedTay Ray Chuan, May 10, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.