aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'local/postrecv-bugs')
-rwxr-xr-xlocal/postrecv-bugs18
1 files changed, 16 insertions, 2 deletions
diff --git a/local/postrecv-bugs b/local/postrecv-bugs
index c36ba56..992815b 100755
--- a/local/postrecv-bugs
+++ b/local/postrecv-bugs
@@ -1,5 +1,4 @@
#!/bin/bash
-# gentoo-infra: infra/githooks.git:local/postrecv-bugs
# Copyright 2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 or later
@@ -30,13 +29,18 @@ while read -r oldrev newrev refname; do
while read -r commithash; do
while read -r l; do
+ is_fixes=0
case ${l} in
# kinda-like github/gitlab/bitbucket but:
# 1. we accept only -s forms for simplicity,
# 2. we accept only footer-style to avoid false positives,
# 3. we have to scan the whole commit message because
# developers still fail to have just one footer.
- Closes:*|Resolves:*|Fixes:*)
+ Closes:*|Resolves:*)
+ close=1;;
+ # normally used to reference commit ids
+ Fixes:*)
+ is_fixes=1
close=1;;
# alternate form to ref without closing
Bug:*)
@@ -47,6 +51,16 @@ while read -r oldrev newrev refname; do
# strip whitespace, split words
bugref=( ${l#*:} )
+ if [[ ${is_fixes} == 1 ]]; then
+ case ${bugref} in
+ # commit ref
+ [0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]*)
+ continue;;
+ *)
+ echo "WARNING: 'Fixes' tag should reference commit id, not: ${bugref[*]}"
+ ;;
+ esac
+ fi
for bug in "${bugref[@]}"; do
case ${bug} in
# long bugzilla URL