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

[PATCH 4/5] Retain extra blank lines between the summary and the body

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Feb 19, 2008, 03:56 UTC
Message-ID
<alpine.LNX.1.00.0802182254240.5816@iabervon.org>
In-Reply-To
<cover.1203392527.git.barkalow@iabervon.org>

This is so that it's possible to have a message that will generate an email with the first line blank. If the email you're generating is actually a template, you may have a single line filling in for a ~3-line paragraph, meaning that the space starts with a blank line, which was impossible before as output from the message-splitting code.

Furthermore, extra blank lines that aren't at the beginning of the body portion aren't stripped, so this is more consistant overall.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
 pretty.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/pretty.c b/pretty.c
index d5db1bd..1c57920 100644
--- a/pretty.c
+++ b/pretty.c
@@ -713,7 +713,6 @@ void pp_remainder(enum cmit_fmt fmt,
 		  struct strbuf *sb,
 		  int indent)
 {
-	int first = 1;
 	for (;;) {
 		const char *line = *msg_p;
 		int linelen = get_one_line(line);
@@ -723,12 +722,9 @@ void pp_remainder(enum cmit_fmt fmt,
 			break;
 
 		if (is_empty_line(line, &linelen)) {
-			if (first)
-				continue;
 			if (fmt == CMIT_FMT_SHORT)
 				break;
 		}
-		first = 0;
 
 		strbuf_grow(sb, linelen + indent + 20);
 		if (indent) {
-- 
1.5.4.1.191.gfbf10
Previous: Daniel BarkalowNext: Daniel Barkalow
Message 9 of 12 in “Add more tests for format-patch”
  1. 1/5 Add more tests for format-patchDaniel Barkalow, Feb 19, 2008
  2. 2/5 Improve message-id generation flow control for format-patchDaniel Barkalow, Feb 19, 2008
  3. Johannes SchindelinFeb 19, 2008
  4. Daniel BarkalowFeb 19, 2008
  5. Johannes SchindelinFeb 19, 2008
  6. 3/5 Export some email and pretty-printing functionsDaniel Barkalow, Feb 19, 2008
  7. Johannes SchindelinFeb 19, 2008
  8. Daniel BarkalowFeb 19, 2008
  9. 4/5 Retain extra blank lines between the summary and the bodyDaniel Barkalow, Feb 19, 2008
  10. 5/5 Add a --cover-letter option to format-patchDaniel Barkalow, Feb 19, 2008
  11. Junio C HamanoFeb 20, 2008
  12. Daniel BarkalowFeb 20, 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.