aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucio Sauer <watermanpaint@posteo.net>2024-06-17 03:08:10 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2024-07-20 08:55:15 +0300
commit2070024ab28255e44bec58202b0494edcdb1e1b7 (patch)
treece1b3123eb6f4115dc1c7e4b33530ce7964f3c77
parentRevert "local/update-03-filename: Allow @ in filenames" (diff)
downloadgithooks-2070024ab28255e44bec58202b0494edcdb1e1b7.tar.gz
githooks-2070024ab28255e44bec58202b0494edcdb1e1b7.tar.bz2
githooks-2070024ab28255e44bec58202b0494edcdb1e1b7.zip
local: add support for commit tags with resolutions FIXED, OBSOLETE, PKGREMOVEDgithooks-20240720T055515Z
Implicitly fall back to resolution FIXED if none is provided. Signed-off-by: Lucio Sauer <watermanpaint@posteo.net> Closes: https://bugs.gentoo.org/934825 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rwxr-xr-xlocal/postrecv-bugs17
1 files changed, 15 insertions, 2 deletions
diff --git a/local/postrecv-bugs b/local/postrecv-bugs
index eac6a30..3d68965 100755
--- a/local/postrecv-bugs
+++ b/local/postrecv-bugs
@@ -1,6 +1,6 @@
#!/bin/bash
# gentoo-infra: infra/githooks.git:postrecv-bugs
-# Copyright 2017 Gentoo Foundation
+# Copyright 2017-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 or later
# Author: Michał Górny <mgorny@gentoo.org>
@@ -15,6 +15,7 @@ ALLOWED_BRANCHES=$(git config --get gentoo.bugs.allowed-branches)
declare -A COMMENT_BUGS=()
declare -A CLOSE_BUGS=()
+declare -A CLOSE_RESO=()
while read -r oldrev newrev refname; do
# operate only on branches in gentoo.bugs.allowed-branches
@@ -63,6 +64,7 @@ while read -r oldrev newrev refname; do
esac
fi
for bug in "${bugref[@]}"; do
+ bug="${bug,,}"
case ${bug} in
# long bugzilla URL
http://bugs.gentoo.org/show_bug.cgi\?*|https://bugs.gentoo.org/show_bug.cgi\?*)
@@ -77,6 +79,15 @@ while read -r oldrev newrev refname; do
# silently ignore github, mirror hook will handle it
http://github.com/*|https://github.com/*)
continue;;
+ \(fixed\)|\(obsolete\)|\(pkgremoved\))
+ resolution="${bug#(}"
+ resolution="${resolution%)}"
+ resolution="${resolution^^}"
+ ;;
+ \(*\))
+ echo "WARNING: invalid/unsupported resolution: ${bug}"
+ continue
+ ;;
*)
echo "WARNING: invalid/unsupported bug ref: ${bug}"
continue;;
@@ -96,9 +107,11 @@ $(git show --pretty=fuller --date=iso-local --stat "${commithash}")"
if [[ ${close} == 1 ]]; then
CLOSE_BUGS[${bugno}]+=${newmsg}
+ CLOSE_RESO[${bugno}]+=${resolution:-FIXED}
else
COMMENT_BUGS[${bugno}]+=${newmsg}
fi
+ unset resolution
done
done < <(git show -q --pretty=format:'%B' "${commithash}")
done < <(git rev-list "${oldrev}..${newrev}")
@@ -113,7 +126,7 @@ for bug in "${!CLOSE_BUGS[@]}"; do
Additionally, it has been referenced in the following commit(s):${COMMENT_BUGS[${bug}]}"
fi
- bugz modify -s RESOLVED -r FIXED -c "${msg}" "${bug}"
+ bugz modify -s RESOLVED -r "${CLOSE_RESO[bug]}" -c "${msg}" "${bug}"
done
for bug in "${!COMMENT_BUGS[@]}"; do