aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-29 18:58:06 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-29 18:58:13 +1200
commitecb09c0b78b6adf4c3cf85f3c08e7d1abec2ecac (patch)
treed5d8ecbefeed4d02c3881daeba3f831ba25eb132
parentRemove unneeded regex escape (diff)
downloaddotfiles-ecb09c0b78b6adf4c3cf85f3c08e7d1abec2ecac.tar.gz
dotfiles-ecb09c0b78b6adf4c3cf85f3c08e7d1abec2ecac.zip
Skip consecutive blanks in merge commits
-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