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

[PATCH] support cover letter before commit log, using "+++"

From
Martin Waitz <tali@admingilde.org>
Date
Jul 23, 2006, 21:45 UTC
Message-ID
<20060723214524.GC20068@admingilde.org>

We already have a "---" separator to end the commit log. But writing the cover letter after this separator looks strange. Now it is possible to put the cover letter and comments both before or after the commit log, as the author sees fit.

Just put the commit log between lines starting with "+++" and "---".
Signed-off-by: Martin Waitz <tali@admingilde.org>
---
 builtin-mailinfo.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index ac53f76..a1cfc81 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -690,6 +690,13 @@ static int handle_commit_msg(int *seen)
 			return 1;
 		}
 
+		/* check for separator between cover-letter and commit log */
+		if (!memcmp("+++", line, 3)) {
+			rewind(cmitmsg);
+			ftruncate(fileno(cmitmsg), 0);
+			continue;
+		}
+
 		/* Unwrap transfer encoding and optionally
 		 * normalize the log message to UTF-8.
 		 */
-- 
1.4.1.gd3582

-- 
Martin Waitz
Next: Junio C Hamano
Message 1 of 4 in “support cover letter before commit log, using "+++"”
  1. support cover letter before commit log, using "+++"Martin Waitz, Jul 23, 2006
  2. Junio C HamanoJul 24, 2006
  3. Martin WaitzJul 24, 2006
  4. Jakub NarebskiJul 24, 2006

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.