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

[PATCH] builtin-commit.c: do not remove COMMIT_EDITMSG

From
Stephan Beyer <s-beyer@gmx.net>
Date
Jan 16, 2009, 19:40 UTC
Message-ID
<1232134805-19597-1-git-send-email-s-beyer@gmx.net>

git-commit tries to remove the file ./COMMIT_EDITMSG instead of $GIT_DIR/COMMIT_EDITMSG after commit preparation (e.g. running hooks, launching editor). This behavior exists since f5bbc3225c4b07 "Port git commit to C".

Some test cases (e.g. t/t7502-commit.sh) rely on the existence of $GIT_DIR/COMMIT_EDITMSG after committing and, I guess, many people are used to it. So it is best not to remove it.

This patch just removes the removal of COMMIT_EDITMSG.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
---
 builtin-commit.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index e88b78f..977ea09 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -624,7 +624,6 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
 	if (!commitable && !in_merge && !allow_empty &&
 	    !(amend && is_a_merge(head_sha1))) {
 		run_status(stdout, index_file, prefix, 0);
-		unlink(commit_editmsg);
 		return 0;
 	}
 
-- 
1.6.1.160.gecdb
Next: Johannes Schindelin
Message 1 of 2 in “builtin-commit.c: do not remove COMMIT_EDITMSG”
  1. builtin-commit.c: do not remove COMMIT_EDITMSGStephan Beyer, Jan 16, 2009
  2. Johannes SchindelinJan 16, 2009

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.