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

Re: [PATCH] merge: make merge state available to prepare-commit-msg hook

From
RBRyan Biesemeyer <ryan@simplymeasured.com>
Date
Jan 8, 2014, 19:03 UTC
Message-ID
<4EE4E1D9-6805-4CA8-8368-6F0EA5EA9F4A@simplymeasured.com>
In-Reply-To
<6B177FFA-1797-45FE-9EF1-2C9E6EE8A234@yaauie.com>
From a1f898fdf560e719d447a544569d5d1457307855 Mon Sep 17 00:00:00 2001
From: Ryan Biesemeyer <ryan@yaauie.com>
Date: Wed, 8 Jan 2014 00:47:41 +0000
Subject: [PATCH 2/2] merge: drop unused arg from abort_commit method signature

Since abort_commit is no longer responsible for writing merge state, remove the unused argument that was originally needed solely for writing merge state.

Signed-off-by: Ryan Biesemeyer <ryan@yaauie.com>
---
 builtin/merge.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/merge.c b/builtin/merge.c
index b7bfc9c..c3108cf 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -795,8 +795,7 @@ static void read_merge_msg(struct strbuf *msg)
 		die_errno(_("Could not read from '%s'"), filename);
 }
 
-static void write_merge_state(struct commit_list *);
-static void abort_commit(struct commit_list *remoteheads, const char *err_msg)
+static void abort_commit(const char *err_msg)
 {
 	if (err_msg)
 		error("%s", err_msg);
@@ -812,6 +811,7 @@ N_("Please enter a commit message to explain why this merge is necessary,\n"
    "Lines starting with '%c' will be ignored, and an empty message aborts\n"
    "the commit.\n");
 
+static void write_merge_state(struct commit_list *);
 static void prepare_to_commit(struct commit_list *remoteheads)
 {
 	struct strbuf msg = STRBUF_INIT;
@@ -824,15 +824,15 @@ static void prepare_to_commit(struct commit_list *remoteheads)
 	write_merge_msg(&msg);
 	if (run_hook(get_index_file(), "prepare-commit-msg",
 		     git_path("MERGE_MSG"), "merge", NULL, NULL))
-		abort_commit(remoteheads, NULL);
+		abort_commit(NULL);
 	if (0 < option_edit) {
 		if (launch_editor(git_path("MERGE_MSG"), NULL, NULL))
-			abort_commit(remoteheads, NULL);
+			abort_commit(NULL);
 	}
 	read_merge_msg(&msg);
 	stripspace(&msg, 0 < option_edit);
 	if (!msg.len)
-		abort_commit(remoteheads, _("Empty commit message."));
+		abort_commit(_("Empty commit message."));
 	strbuf_release(&merge_msg);
 	strbuf_addbuf(&merge_msg, &msg);
 	strbuf_release(&msg);
-- 
1.8.5
Previous: Matthieu MoyNext: Ryan Biesemeyer
Message 9 of 18 in “merge: make merge state available to prepare-commit-msg hook”
  1. merge: make merge state available to prepare-commit-msg hookRyan Biesemeyer, Jan 8, 2014
  2. Ryan BiesemeyerJan 8, 2014
  3. Matthieu MoyJan 8, 2014
  4. Ryan BiesemeyerJan 8, 2014
  5. Jonathan NiederJan 8, 2014
  6. Matthieu MoyJan 8, 2014
  7. Jonathan NiederJan 8, 2014
  8. Matthieu MoyJan 9, 2014
  9. Ryan BiesemeyerJan 8, 2014
  10. 0/4 merge: make merge state available to prepare-commit-msg hookRyan Biesemeyer, Jan 9, 2014
  11. 1/4 t7505: add missing &&Ryan Biesemeyer, Jan 9, 2014
  12. 2/4 t7505: ensure cleanup after hook blocks mergeRyan Biesemeyer, Jan 9, 2014
  13. Matthieu MoyJan 9, 2014
  14. Junio C HamanoJan 10, 2014
  15. 3/4 merge: make prepare_to_commit responsible for write_merge_stateRyan Biesemeyer, Jan 9, 2014
  16. Junio C HamanoJan 11, 2014
  17. Junio C HamanoJan 11, 2014
  18. 4/4 merge: drop unused arg from abort_commit method signatureRyan Biesemeyer, Jan 9, 2014

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.