aboutsummaryrefslogtreecommitdiff
path: root/git
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-29 18:47:42 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-29 18:48:40 +1200
commit0635832fe5614cd06a5a0fc6e683404712c27dcf (patch)
treeca9c940cbdb736e4375df0dcccfe6d419695b08a /git
parentAdjust prepare-commit-msg hook to arguments (diff)
downloaddotfiles-0635832fe5614cd06a5a0fc6e683404712c27dcf.tar.gz
dotfiles-0635832fe5614cd06a5a0fc6e683404712c27dcf.zip
Handle blank lines and comments in merge commits
Diffstat (limited to 'git')
-rwxr-xr-xgit/template/hooks/prepare-commit-msg.awk3
1 files changed, 3 insertions, 0 deletions
diff --git a/git/template/hooks/prepare-commit-msg.awk b/git/template/hooks/prepare-commit-msg.awk
index 800e2220..2ee8d3a9 100755
--- a/git/template/hooks/prepare-commit-msg.awk
+++ b/git/template/hooks/prepare-commit-msg.awk
@@ -15,6 +15,9 @@ BEGIN {
next
}
+# This line is blank, or a comment; reset the branch
+!NF || $1 ~ /^\#/ { branch = 0 }
+
# Commit message subject patterns to skip go here; be as precise as you can
$0 == " Bump VERSION" { next } # Skip version number bumps