git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] support cover letter before commit log, using "+++"
@ 2006-07-23 21:45 Martin Waitz
  2006-07-24  6:54 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Waitz @ 2006-07-23 21:45 UTC (permalink / raw)
  To: git

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-07-24  9:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-23 21:45 [PATCH] support cover letter before commit log, using "+++" Martin Waitz
2006-07-24  6:54 ` Junio C Hamano
2006-07-24  7:04   ` Martin Waitz
2006-07-24  9:53     ` Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).