git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Re : 2 questions on git-send-email usage

From
FBFranck Bui-Huu <vagabon.xyz@gmail.com>
Date
Jul 12, 2006, 07:37 UTC
Message-ID
<44B4A6CA.3020206@innova-card.com>
In-Reply-To
<7vd5cc3q0o.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 6 quoted lines
> 
> Haven't checked the code around the patch yet, but does it work
> when the original commit log message ends with a blank line and
> existing signed-off-by lines by other people?  You do not want
> an extra blank lines there.
> 

argh, no I just tested the previous case. Here is an update which fix all cases.

-- >8 --
[PATCH] Add a newline before appending "Signed-off-by:"
It looks nicer.
Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
---
 log-tree.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/log-tree.c b/log-tree.c
index 9d8d46f..69d5c8a 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -17,9 +17,10 @@ static int append_signoff(char *buf, int
 	int signoff_len = strlen(signoff);
 	static const char signed_off_by[] = "Signed-off-by: ";
 	char *cp = buf;
+	int has_signoff = 0;
 
 	/* Do we have enough space to add it? */
-	if (buf_sz - at <= strlen(signed_off_by) + signoff_len + 2)
+	if (buf_sz - at <= strlen(signed_off_by) + signoff_len + 3)
 		return at;
 
 	/* First see if we already have the sign-off by the signer */
@@ -32,8 +33,11 @@ static int append_signoff(char *buf, int
 		    !strncmp(cp, signoff, signoff_len) &&
 		    isspace(cp[signoff_len]))
 			return at; /* we already have him */
+		has_signoff = 1;
 	}
 
+	if (!has_signoff)
+		buf[at++] = '\n';
 	strcpy(buf + at, signed_off_by);
 	at += strlen(signed_off_by);
 	strcpy(buf + at, signoff);
-- 
1.4.1.g55b7
Previous: Junio C HamanoNext: Linus Torvalds
Message 4 of 10 in “Re : 2 questions on git-send-email usage”
  1. moreau francisJul 11, 2006
  2. Franck Bui-HuuJul 11, 2006
  3. Junio C HamanoJul 11, 2006
  4. Franck Bui-HuuJul 12, 2006
  5. Linus TorvaldsJul 12, 2006
  6. Junio C HamanoJul 12, 2006
  7. Junio C HamanoJul 12, 2006
  8. Linus TorvaldsJul 12, 2006
  9. Junio C HamanoJul 13, 2006
  10. Linus TorvaldsJul 13, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.