aboutsummaryrefslogtreecommitdiff
path: root/git-commit.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-01-29 01:06:27 -0800
committerJunio C Hamano <junkio@cox.net>2007-01-29 01:06:27 -0800
commitdbaa06a2b0f58b7bf1d337380eb61fa4064c1b15 (patch)
tree7be50a0fff54e92c8e4b1bdb8a52868e073610ea /git-commit.sh
parentdef2747d0e0b62e326564631fa5441bd1f270ee9 (diff)
downloadgit-dbaa06a2b0f58b7bf1d337380eb61fa4064c1b15.tar.gz
git-dbaa06a2b0f58b7bf1d337380eb61fa4064c1b15.tar.xz
git-commit -s: no extra space when sign-offs appear at the end already.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-commit.sh')
-rwxr-xr-xgit-commit.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-commit.sh b/git-commit.sh
index 85c278afa..dc0fc3b67 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -442,8 +442,11 @@ fi | git-stripspace >"$GIT_DIR"/COMMIT_EDITMSG
case "$signoff" in
t)
+ need_blank_before_signoff=
+ tail -n 1 "$GIT_DIR"/COMMIT_EDITMSG |
+ grep 'Signed-off-by:' >/dev/null || need_blank_before_signoff=yes
{
- echo
+ test -z "$need_blank_before_signoff" || echo
git-var GIT_COMMITTER_IDENT | sed -e '
s/>.*/>/
s/^/Signed-off-by: /