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

[PATCH] builtin-commit: run commit-msg hook with correct message file

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 18, 2007, 20:30 UTC
Message-ID
<7v1wanuwiy.fsf_-_@gitster.siamese.dyndns.org>
In-Reply-To
<7vejenuy4i.fsf@gitster.siamese.dyndns.org>
It should run with $GIT_DIR/COMMIT_EDITMSG, not just COMMIT_EDITMSG.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * Other things I noticed that are still broken:
   - "git commit -v" does not give you the diff in the message
     template for your final review;
   - message_is_empty() is bogus.  It does run stripspace() but
     does not strip out the diff "git commit -v" would produce
     before doing its comparison;
 builtin-commit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index 058cd32..439fcc2 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -753,7 +753,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 		rollback_index_files();
 		die("could not read commit message\n");
 	}
-	if (run_hook(index_file, "commit-msg", commit_editmsg)) {
+	if (run_hook(index_file, "commit-msg", git_path(commit_editmsg))) {
 		rollback_index_files();
 		exit(1);
 	}
-- 
1.5.3.5.1815.g9445b
Previous: Junio C HamanoNext: Ping Yin
Message 3 of 4 in “builtin-commit: Fix git-commit honoring status.color”
  1. builtin-commit: Fix git-commit honoring status.colorPing Yin, Nov 18, 2007
  2. Junio C HamanoNov 18, 2007
  3. builtin-commit: run commit-msg hook with correct message fileJunio C Hamano, Nov 18, 2007
  4. Ping YinNov 19, 2007

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.