Skip to contentSkip to conversation

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

PATCH In review Martin Waitz 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support cover letter before commit log, using "+++"

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

---
 builtin-mailinfo.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
builtin-mailinfo.c +7 -0
index ac53f76..a1cfc81 100644
@@ -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.
 		 */
Signature · 4 lines
1.4.1.gd3582

-- 
Martin Waitz
#1 lore raw
Quoted 8 lines · Martin Waitz

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

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?

#2 lore raw

hoi :)

Quoted 11 lines · Junio C Hamano
Quoted 8 lines · Martin Waitz

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

Quoted 7 lines

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

Quoted 4 lines

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

Signature · 1 line
Martin Waitz
#3 lore raw
Quoted 3 lines · Martin Waitz

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

Quoted 1 line

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

True.

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git