Thread View: linux.gentoo.dev
1 messages
1 total messages
Started by Thomas Bracht Laumann Jespersen
Sun, 25 Oct 2026 08:50
[gentoo-dev] [PATCH infra/githooks] local/postrecv-bugs: improve defaults for {allowed,close}-branches
Author: Thomas Bracht Laumann Jespersen
Date: Sun, 25 Oct 2026 08:50
Date: Sun, 25 Oct 2026 08:50
51 lines
3488 bytes
3488 bytes
Ensure that CLOSE_BRANCHES defaults to ALLOWED_BRANCHES in all cases,
and that ALLOWED_BRANCHES defaults to master. Migrate away from the
deprecated git-config(1) modes and use the newer "git config get"
subcommand instead of "git config --get".
Signed-off-by: Thomas Bracht Laumann Jespersen <laumann@gentoo.org>
---
local/postrecv-bugs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/local/postrecv-bugs b/local/postrecv-bugs
index ffba700..245f759 100755
--- a/local/postrecv-bugs
+++ b/local/postrecv-bugs
@@ -15,8 +15,8 @@ shopt -o -s noglob
# operate on to post comments or close bugs, and mark Codeberg PRs as
# closed/merged. CLOSE_BRANCHES lists the branches where closing bugs
# is permitted and is ideally a subset of ALLOWED_BRANCHES.
-ALLOWED_BRANCHES=$(git config --get gentoo.bugs.allowed-branches)
-CLOSE_BRANCHES=$(git config --get gentoo.bugs.close-branches)
+ALLOWED_BRANCHES=$(git config get --default=master gentoo.bugs.allowed-branches)
+CLOSE_BRANCHES=$(git config get --default="${ALLOWED_BRANCHES}" gentoo.bugs.close-branches)
declare -A COMMENT_BUGS=()
declare -A CLOSE_BUGS=()
@@ -27,7 +27,7 @@ while read -r oldrev newrev refname; do
# operate only on branches in gentoo.bugs.allowed-branches
# (or 'master' if unset)
allowed=0
- for allowed_branch in ${ALLOWED_BRANCHES:-master}; do
+ for allowed_branch in ${ALLOWED_BRANCHES}; do
if [[ ${refname#refs/heads/} == ${allowed_branch} ]]; then
allowed=1
break
@@ -36,7 +36,7 @@ while read -r oldrev newrev refname; do
[[ ${allowed} == 0 ]] && continue
close_allowed=0
- for close_branch in ${CLOSE_BRANCHES:-${ALLOWED_BRANCHES}}; do
+ for close_branch in ${CLOSE_BRANCHES}; do
if [[ ${refname#refs/heads/} == ${close_branch} ]]; then
close_allowed=1
break
---
base-commit: 9e0fda70b4260f7c3aa386f16af4173a3891ff82
change-id: 20261025-close-branches-defaults-525edb01de27
Best regards,
--
Thomas Bracht Laumann Jespersen <laumann@gentoo.org>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads