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

[PATCH] builtin-commit: Clean up an unused variable and a debug fprintf().

From
Kristian Høgsberg <krh@redhat.com>
Date
Nov 14, 2007, 15:31 UTC
Message-ID
<1195054313-17607-1-git-send-email-krh@redhat.com>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
---
 builtin-commit.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index 7a8cb57..7841310 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -514,7 +514,7 @@ static const char commit_utf8_warn[] =
 
 int cmd_commit(int argc, const char **argv, const char *prefix)
 {
-	int header_len, parent_count = 0;
+	int header_len;
 	struct strbuf sb;
 	const char *index_file, *reflog_msg;
 	char *nl;
@@ -550,7 +550,6 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 	/* Determine parents */
 	if (initial_commit) {
 		reflog_msg = "commit (initial)";
-		parent_count = 0;
 	} else if (amend) {
 		struct commit_list *c;
 		struct commit *commit;
@@ -591,10 +590,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 
 	/* Get the commit message and validate it */
 	header_len = sb.len;
-	if (!no_edit) {
-		fprintf(stderr, "launching editor, log %s\n", logfile);
+	if (!no_edit)
 		launch_editor(git_path(commit_editmsg), &sb);
-	} else if (strbuf_read_file(&sb, git_path(commit_editmsg), 0) < 0)
+	else if (strbuf_read_file(&sb, git_path(commit_editmsg), 0) < 0)
 		die("could not read commit message\n");
 	if (run_hook(index_file, "commit-msg", commit_editmsg))
 		exit(1);
-- 
1.5.3.5.1822.g11971-dirty
Message 1 of 1 in “builtin-commit: Clean up an unused variable and a debug fprintf().”
  1. builtin-commit: Clean up an unused variable and a debug fprintf().Kristian Høgsberg, Nov 14, 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.