Article View: linux.gentoo.dev
Article #62[gentoo-dev] [PATCH infra/githooks] local/postrecv-bugs: improve defaults for {allowed,close}-branches
From: 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>
Technical Details
Message-ID:
<NS25r-7KWs-1@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!gothmog.csi.it!bofh.it!news.nic.it!robomodShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Thomas Bracht Laumann Jespersen <laumann@gentoo.org>
Newsgroups: linux.gentoo.dev
Subject: [gentoo-dev] [PATCH infra/githooks] local/postrecv-bugs: improve defaults for {allowed,close}-branches
Date: Sun, 25 Oct 2026 09:50:01 +0100
Message-ID: <NS25r-7KWs-1@gated-at.bofh.it>
List-ID: Gentoo Linux mail <gentoo-dev.gentoo.org>
Reply-To: gentoo-dev@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yXMywqDMBBG4VeRWXcgGUgLfZXSRS6/NUViyagUx
HdvtMtvcc5GipqhdO82qliz5qk02EtHcfDlBc6pmcTI1RpxHMdJwaH6EgcoJ/R+GWdlJw4pGJs
gN2r1p6LP3/P8eP6tS3gjzseO9v0H0R6uCXsAAAA=
X-Change-ID: 20261025-close-branches-defaults-525edb01de27
X-Mailer: b4 0.16.0
Approved: robomod@news.nic.it
Lines: 51
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Cc: Thomas Bracht Laumann Jespersen <laumann@gentoo.org>
X-Original-Date: Sun, 25 Oct 2026 09:42:09 +0100
X-Original-Message-ID: <20261025-close-branches-defaults-v1-1-10881538167e@gentoo.org>