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

[PATCH 2/2] commit: do not add a newline after a template

From
Boris Faure <billiob@gmail.com>
Date
May 7, 2011, 15:53 UTC
Message-ID
<1304783624-9919-2-git-send-email-billiob@gmail.com>
In-Reply-To
<1304783624-9919-1-git-send-email-billiob@gmail.com>
Signed-off-by: Boris Faure <billiob@gmail.com>
---
 builtin/commit.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/builtin/commit.c b/builtin/commit.c
index f0e880b..2209924 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -754,7 +754,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 					 ? "MERGE_HEAD"
 					 : "CHERRY_PICK_HEAD"));
 
-		fprintf(s->fp, "\n");
+		if (!template_file)
+			fprintf(s->fp, "\n");
 		status_printf(s, GIT_COLOR_NORMAL,
 			_("Please enter the commit message for your changes."));
 		if (cleanup_mode == CLEANUP_ALL)
-- 
1.7.5.1
Previous: Boris FaureNext: Junio C Hamano
Message 2 of 11 in “commit: do not cleanup template”
  1. 1/2 commit: do not cleanup templateBoris Faure, May 7, 2011
  2. 2/2 commit: do not add a newline after a templateBoris Faure, May 7, 2011
  3. Junio C HamanoMay 7, 2011
  4. Boris 'billiob' FaureMay 7, 2011
  5. Junio C HamanoMay 7, 2011
  6. Sebastian SchuberthMay 8, 2011
  7. Sebastian SchuberthMay 8, 2011
  8. Do not strip empty lines / trailing spaces from a commit message templateBoris Faure, May 8, 2011
  9. Sebastian SchuberthMay 8, 2011
  10. Junio C HamanoMay 8, 2011
  11. Do not strip empty lines / trailing spaces from a commit message templateBoris Faure, May 8, 2011

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.