DORMANTno replies

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

From: Martin Waitz <hidden>
Date: 2016-06-15 22:42:34
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help