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

[PATCH] builtin-commit: Two trivial style-cleanups

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 22, 2008, 20:40 UTC
Message-ID
<alpine.DEB.1.00.0807222139550.8986@racer>

Pierre Habouzit noticed that two variables were not static which should have been, and that adding "\n\n" is better than adding '\n' twice.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
	This was in my queue for half an eternity.
	Oh, and it _is_ meant for inclusion.  On top of master.
 builtin-commit.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index 97e64de..7434797 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -68,8 +68,8 @@ static enum {
 static char *cleanup_arg;
 
 static int use_editor = 1, initial_commit, in_merge;
-const char *only_include_assumed;
-struct strbuf message;
+static const char *only_include_assumed;
+static struct strbuf message;
 
 static int opt_parse_m(const struct option *opt, const char *arg, int unset)
 {
@@ -78,8 +78,7 @@ static int opt_parse_m(const struct option *opt, const char *arg, int unset)
 		strbuf_setlen(buf, 0);
 	else {
 		strbuf_addstr(buf, arg);
-		strbuf_addch(buf, '\n');
-		strbuf_addch(buf, '\n');
+		strbuf_addstr(buf, "\n\n");
 	}
 	return 0;
 }
-- 
1.6.0.rc0.22.gf2096d.dirty
Message 1 of 1 in “builtin-commit: Two trivial style-cleanups”
  1. builtin-commit: Two trivial style-cleanupsJohannes Schindelin, Jul 22, 2008

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.