From nobody Mon Apr 21 21:55:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZhK1K5ZjZz5t604; Mon, 21 Apr 2025 21:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZhK1K1s8gz3hy5; Mon, 21 Apr 2025 21:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745272533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uqlYcWQM3tyl/E7DW8zUHtizMAj+79Yu5E1VDbjOATU=; b=oz2zVsXuDfPQeQR0C7CKTkafL9XEKTorBnB+bg84c7fmIv+1lqv1lmRWMtlHf4UTKE2INJ Tv10C6urznR2bDvjTZ3/hzXk8hgvSV0yDcvN0yoAErh7m2GbVJubfOyvtz7nJZsNP++TtI SypApodZNvd7M5lJOo0mklTOgetNkPEIeNXUN3+bDX4QhGv3nx0Ab4AdlBO8lue7KVnzbA U19PXPMVZINOgUbV/pQm3mYh3XG4uKuWjMHJOnAFFJm005FddWAY6cFK4Z1DuCLjyr4k/k YqFEUMLVJUkqtqf8tFlfalsAhp1bTOSKaxz/uTt537HyyxdSwYoOzcYt44aOkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745272533; a=rsa-sha256; cv=none; b=FuMQNhUEYzD5ASmNQ+MHEyPCyaptfMFZq6CU0tlAqXdFS5zj0DXADKVQCCrKsgc/+eE4RQ Ev430wQZXsIlr41RZ40U8K4jCN3CDpPZb/FsxwIdjKzsBWlu/xOE5h4YuNskcvyzwdWGES M6Pc2Tlv/qKit14XBx5g6ve1PzRlxZqbaN7kIdLF1Km7l5m8uVFdT6YNGBMDNtPngWmzF/ HbZbNfaf20PF9Z1ZycRKZl1yE8q0RRkuHyTR5oMtQyXGg5SVQT021FMfkeE8xA8st4xpO4 DlYe56FODIH87Oue2VUvrn4JdfAEHBTTnXMQ9MUA81OvaIDcweFSrnahCJ0dDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745272533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uqlYcWQM3tyl/E7DW8zUHtizMAj+79Yu5E1VDbjOATU=; b=kKmFoqWZY4u1LDPnaZCw/sg3JDSMVivsnrCbiJo1mu1mcx7KAeyqHW1ePnTNr2E/RUIfsZ mDFBWUGek8drl5ULx/v3qFOiP2MX3+pUnu9BZTsn369RdNbdHqwrVxOLRd4cqD7DB8fjwX teNXuJS/YiAEAOa5eGr3Ng/iucJhdgu2RsXfI43hs1QsnhYMxM08Ai07y6fuNq61Uf0OUy uQP4kZ7OrUrKpiEb+0P1/YAVn4UQt5dVzA4zy5RWSMxlAz0b/b3N2CKwa5tUGIQSYrCdxL cjcncybXihAr230e8oaN1hkUWhc0fMjTPkfT0knDVzUhe6RTTJqrnZKApvjfJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZhK1K1N2Wz166T; Mon, 21 Apr 2025 21:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 53LLtXlq007545; Mon, 21 Apr 2025 21:55:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53LLtXil007542; Mon, 21 Apr 2025 21:55:33 GMT (envelope-from git) Date: Mon, 21 Apr 2025 21:55:33 GMT Message-Id: <202504212155.53LLtXil007542@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 6fb2339611cd - main - ghpr: Only label the branch as merged List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fb2339611cd19271fd5ae1034f5dddad36c59dc Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6fb2339611cd19271fd5ae1034f5dddad36c59dc commit 6fb2339611cd19271fd5ae1034f5dddad36c59dc Author: Warner Losh AuthorDate: 2025-04-21 21:52:49 +0000 Commit: Warner Losh CommitDate: 2025-04-21 21:55:00 +0000 ghpr: Only label the branch as merged Stop trying to push to the pull request branches. Only I have permission to do that. Add 'meged' tag. This isn't quite as good as having the PRs show up as 'merged' since there's some stats based on that which won't happen. However, it's too much of a hassle, so just stop doing it. We now require the 'gh' but don't make sure that it's around. Note: We still need better error handling, for this and other things. Sponsored by: Netflix --- tools/tools/git/ghpr/ghpr-push.sh | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/tools/tools/git/ghpr/ghpr-push.sh b/tools/tools/git/ghpr/ghpr-push.sh index 21cd9b52e41b..587a0bb8ff27 100644 --- a/tools/tools/git/ghpr/ghpr-push.sh +++ b/tools/tools/git/ghpr/ghpr-push.sh @@ -8,24 +8,35 @@ die() { } staging=staging +do_pr_branch_push=false + # Iteratively try to push all the branches, then push upstream. Repeat until the upstream # push works... while true; do - for pr in $(git config --get-all branch.${staging}.opabinia.prs); do - upstream=$(git config --get branch.${staging}.opabinia.${pr}.upstream) - upstream_branch=$(git config --get branch.${staging}.opabinia.${pr}.upstream-branch) - - git push $upstream HEAD:$upstream_branch --force || true # bare git push gives cut and paste line - done + # We'll likely drop pushing to the pull request branches, but that's not + # final, so keep the code, but if false'd out. We'll make it a proper option + # or remove it once the discussion settles down. Only Warner can use it at + # the moment anyway. + if $do_pr_branch_push; then + for pr in $(git config --get-all branch.${staging}.opabinia.prs); do + upstream=$(git config --get branch.${staging}.opabinia.${pr}.upstream) + upstream_branch=$(git config --get branch.${staging}.opabinia.${pr}.upstream-branch) + git push $upstream HEAD:$upstream_branch --force || true # bare git push gives cut and paste line + done + fi if ! git push --push-option=confirm-author freebsd HEAD:main; then git fetch freebsd - git rebase freebsd/main ${stagig} + git rebase freebsd/main ${staging} continue fi break done +else + +fi + # OK, pull and rebase to catchup to these changes... git checkout main; @@ -33,7 +44,11 @@ git pull --rebase # try to cleanup for pr in $(git config --get-all branch.${staging}.opabinia.prs); do + if ! $do_pr_branch_push; then + gh pr edit $pr --edit --add-label merged + fi git branch -D PR-${pr} git config --remove-section branch.${staging}.opabinia.${pr} done git config --remove-section branch.${staging}.opabinia +git branch -D ${staging}