threads / patch / 4967

patchsupport cover letter before commit log, using "+++"

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

## tl;dr

4 messages between Jul 23, 2006 and Jul 24, 2006. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Martin Waitz· Jul 23, 2006, 21:45 UTC · lore

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(-)
Show changes to builtin-mailinfo.c +7 −0
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· Jul 24, 2006, 06:54 UTC · re: Martin Waitz · lore

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

Martin Waitz <tali@admingilde.org> writes:
Show 8 quoted lines
> 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· Jul 24, 2006, 07:04 UTC · re: Junio C Hamano · lore

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

hoi :)
On Sun, Jul 23, 2006 at 11:54:22PM -0700, Junio C Hamano wrote:
Show 18 quoted lines
> 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· Jul 24, 2006, 09:53 UTC · re: Martin Waitz · lore

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

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

← back to recent threads