From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: Junio C Hamano <junkio@cox.net>
Cc: Franck <vagabon.xyz@gmail.com>, git@vger.kernel.org
Subject: Re: Re : 2 questions on git-send-email usage
Date: Wed, 12 Jul 2006 09:37:46 +0200 [thread overview]
Message-ID: <44B4A6CA.3020206@innova-card.com> (raw)
In-Reply-To: <7vd5cc3q0o.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
>
> 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
next prev parent reply other threads:[~2006-07-12 7:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-11 8:46 Re : 2 questions on git-send-email usage moreau francis
2006-07-11 10:08 ` Franck Bui-Huu
2006-07-11 19:22 ` Junio C Hamano
2006-07-12 7:37 ` Franck Bui-Huu [this message]
2006-07-12 15:43 ` Linus Torvalds
2006-07-12 16:19 ` Junio C Hamano
2006-07-12 16:24 ` Junio C Hamano
2006-07-12 16:37 ` Linus Torvalds
2006-07-13 4:34 ` Junio C Hamano
2006-07-13 4:40 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44B4A6CA.3020206@innova-card.com \
--to=vagabon.xyz@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).