aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-03-01 20:56:57 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2011-03-01 20:59:04 -0500
commite55228712831a2422cc1c171a6a1160c20d25f1e (patch)
tree9699c63b0f9745880b9ea109b88eb8412cf45b93
parent[ticket/9824] Allow empty lines after ticket reference. (diff)
downloadphpbb-e55228712831a2422cc1c171a6a1160c20d25f1e.tar.gz
phpbb-e55228712831a2422cc1c171a6a1160c20d25f1e.tar.bz2
phpbb-e55228712831a2422cc1c171a6a1160c20d25f1e.zip
[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
-rwxr-xr-xgit-tools/hooks/commit-msg14
1 files changed, 13 insertions, 1 deletions
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;