From e55228712831a2422cc1c171a6a1160c20d25f1e Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Tue, 1 Mar 2011 20:56:57 -0500 Subject: [ticket/9824] Accept commit messages with less than perfect headings. Some commit messages exist only temporarily, because they are given on commits that are intended to be squashed. Accept such commit messages with a warning. PHPBB3-9824 --- git-tools/hooks/commit-msg | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'git-tools/hooks') diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg index 319e27b811..ad4d69a9da 100755 --- a/git-tools/hooks/commit-msg +++ b/git-tools/hooks/commit-msg @@ -118,7 +118,19 @@ do case $expect in "header") err=$ERR_HEADER; - echo "$line" | grep -Eq "^\[(ticket/[0-9]+|feature/$branch_regex|task/$branch_regex)\] [A-Z].+$" + echo "$line" | grep -Eq "^\[(ticket/[0-9]+|feature/$branch_regex|task/$branch_regex)\] .+$" + result=$? + if ! echo "$line" | grep -Eq "^\[(ticket/[0-9]+|feature/$branch_regex|task/$branch_regex)\] [A-Z].+$" + then + # Don't be too strict. + # Commits may be temporary, intended to be squashed later. + # Just issue a warning here. + echo "Warning: heading should be a sentence beginning with a capital letter." 1>&2 + echo "You entered:" 1>&2 + echo "$line" 1>&2 + fi + # restore exit code + (exit $result) ;; "empty") err=$ERR_EMPTY; -- cgit v1.2.1