From: Junio C Hamano Date: Mon, 29 Jan 2007 09:06:27 +0000 (-0800) Subject: git-commit -s: no extra space when sign-offs appear at the end already. X-Git-Tag: v1.5.0-rc3~20 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dbaa06a2b0f58b7bf1d337380eb61fa4064c1b15;p=git.git git-commit -s: no extra space when sign-offs appear at the end already. Signed-off-by: Junio C Hamano --- 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: /