From d0da23026660396b8b3430a83ae4888c712033d6 Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Sat, 3 Oct 2020 01:30:04 +0200 Subject: [PATCH] git:hook:commit-msg: Allow some special characters Allow some special character in the program name specification in the subject line. --- meta/git/hooks/commit-msg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meta/git/hooks/commit-msg b/meta/git/hooks/commit-msg index a4be7b3..b86a52d 100755 --- a/meta/git/hooks/commit-msg +++ b/meta/git/hooks/commit-msg @@ -19,13 +19,13 @@ body="$(tail +2 "$1" | grep -v "^#")" [ ${#subject} -le 50 ] || die "Subject too long. (<= 50)\n" -if ! echo "$subject" | grep -qE "^([a-z]+:)+ "; then +if ! echo "$subject" | grep -qE "^([-_,a-z]+:)+ "; then die "Specify which program was modified. (e.g. \"zsh:p10k: \")\n" fi -if ! echo "$subject" | grep -qE "^([a-z]+:)+ [A-Z]"; then +if ! echo "$subject" | grep -qE "^([-_,a-z]+:)+ [A-Z]"; then die "Start subject with a capital letter.\n" fi -if ! echo "$subject" | grep -qE "^([a-z]+:)+ [A-Z].*[^.]$"; then +if ! echo "$subject" | grep -qE "^([-_,a-z]+:)+ [A-Z].*[^.]$"; then die "Remove punctuation mark from end.\n" fi