aboutsummaryrefslogtreecommitdiff
path: root/git/template/hooks/prepare-commit-msg.awk
diff options
context:
space:
mode:
Diffstat (limited to 'git/template/hooks/prepare-commit-msg.awk')
-rwxr-xr-xgit/template/hooks/prepare-commit-msg.awk4
1 files changed, 4 insertions, 0 deletions
diff --git a/git/template/hooks/prepare-commit-msg.awk b/git/template/hooks/prepare-commit-msg.awk
index 44913406..3be115b1 100755
--- a/git/template/hooks/prepare-commit-msg.awk
+++ b/git/template/hooks/prepare-commit-msg.awk
@@ -22,6 +22,10 @@ BEGIN {
# Commit message subject patterns to skip go here; be as precise as you can
$0 == " Bump VERSION" { next } # Skip version number bumps
+# Don't emit consecutive blanks
+NF { blank = 0 }
+!NF && blank++ { next }
+
# If we got past this point, we have an actual commit line to include, so if
# there's a branch heading yet to print, we should do so now; add it to the
# line buffer