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

4 messages from 2006-07-23 to 2006-07-24. Participants: Martin Waitz, Junio C Hamano, Jakub Narebski.
Thread: https://gitlist.dev/t/4967

## Martin Waitz, 2006-07-23 21:45

Subject: [PATCH] support cover letter before commit log, using "+++"
Message-ID: <20060723214524.GC20068@admingilde.org>
URL: https://gitlist.dev/e/20060723214524.GC20068%40admingilde.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

```

## Junio C Hamano, 2006-07-24 06:54

Subject: Re: [PATCH] support cover letter before commit log, using "+++"
Message-ID: <7v1wsbfq75.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v1wsbfq75.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060723214524.GC20068@admingilde.org>

```
Martin Waitz <tali@admingilde.org> writes:

> 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>

I do not have problem with the implementation itself, but

* I always had an impression that cover letters are tolerated
  not encouraged.  In other words, as a good practice it would
  be nice if necessary information is described in the commit
  log messages themselves.  Do we want to start encouraging the
  cover letter with this patch?

* Has anybody ever used that "+++" as an auxiliary separator?
  In other words, is it an established convention?  If not,
  would it be a good convention that we would want to establish
  here?

```

## Martin Waitz, 2006-07-24 07:04

Subject: Re: [PATCH] support cover letter before commit log, using "+++"
Message-ID: <20060724070438.GD20068@admingilde.org>
URL: https://gitlist.dev/e/20060724070438.GD20068%40admingilde.org
In-Reply-To: <7v1wsbfq75.fsf@assigned-by-dhcp.cox.net>

```
hoi :)

On Sun, Jul 23, 2006 at 11:54:22PM -0700, Junio C Hamano wrote:
> Martin Waitz <tali@admingilde.org> writes:
> 
> > 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>
> 
> I do not have problem with the implementation itself, but
> 
> * I always had an impression that cover letters are tolerated
>   not encouraged.  In other words, as a good practice it would
>   be nice if necessary information is described in the commit
>   log messages themselves.  Do we want to start encouraging the
>   cover letter with this patch?

that's right, but:

 * before using automatic tools to generate mails from patches people
   started their mails with "hello" or something similiar.
   As these lines are frowned upon in the changelog people just stop
   being polite.

 * I have often seen patches evolving in an email thread.
   With such an separator it is possible to keep the thread history
   in one part and a clean change message in another part.

I don't really know if this +++ thing will be used much. It's just
something that I thought might be missing and it was easy to do ;-)

> * Has anybody ever used that "+++" as an auxiliary separator?
>   In other words, is it an established convention?  If not,
>   would it be a good convention that we would want to establish
>   here?

I haven't seen the "+++" before here. People have used their own
"cut here" markers somethimes but I don't think their is an
established convention already.
The "+++" just felt good in combination with the "---" end marker.

-- 
Martin Waitz

```

## Jakub Narebski, 2006-07-24 09:53

Subject: Re: [PATCH] support cover letter before commit log, using "+++"
Message-ID: <ea25am$1qa$1@sea.gmane.org>
URL: https://gitlist.dev/e/ea25am%241qa%241%40sea.gmane.org
In-Reply-To: <20060724070438.GD20068@admingilde.org>

```
Martin Waitz wrote:

> I haven't seen the "+++" before here. People have used their own
> "cut here" markers somethimes but I don't think their is an
> established convention already.

Most common I think is the variation of "scissors" separator, i.e.

-- >8 --

> The "+++" just felt good in combination with the "---" end marker.

True.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```
