agent-guard: the +refspec force spelling bypasses the empty-rebase guard
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
調査の方向性
tools/agent-guard/src/agent_guard/__init__.pyのguard_empty_rebase周辺と、既存のguardテストを読む。pushの引数から強制refspecを特定する方法と、ソースrefの解決方法をたどり、関連するguardテストを実行する。空のブランチに対してgit push origin +pr:mainが拒否され、既存のforce flagのケースも引き続き想定どおりに動作すれば完了。
索引モデルが issue の本文から書いたものです。
説明
What's broken
The bundled empty-rebase guard recognizes only -f, --force and --force-with-lease[=...] as a force-push. git-push(1) documents a + refspec prefix as equivalent to --force for that refspec, so git push origin +empty-branch:main — a standard force-push spelling — reaches the push without the guard firing. The guard exists because force-pushing a branch with 0 commits over its base to a PR head auto-closes the PR and revokes maintainer write access.
Where
guard_empty_rebase in tools/agent-guard/src/agent_guard/__init__.py (line ~882 on main @ dadb315c): the forced check scans only flags, and the src-ref resolution keeps the leading +, so even recognizing the flag alone would not be enough.
Reproduce
Repo with a bare origin (origin/HEAD -> main), empty branch pr:
git push --force origin pr:main # denied by the guard
git push origin +pr:main # allowed — same semantics, no deny
Both spellings have identical push semantics; the second one is allowed through.
Suggested fix
Treat any refspec positional starting with + as forced, and strip the prefix before resolving src (git rev-parse +ref fails and would fail open). Patch and tests ready; happy to send a PR.
- 主要言語
- Python
- スター
- 113
- フォーク
- 95
- 平均マージ
- 10時間 48分
- マージ済み PR(30日)
- 348
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/magpie のほかの issue
-
PR stats parity tests can publish or overwrite real gists対応中かも @MakerFlyFly が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜2日 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
Marketplace install fails with GitHub Copilot対応中かも @opwvhk が 1 日前に担当しました。 オープンbug
難易度 3/5 半日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
Explore Claude Code mods across the skill families対応中かも @Kaap10 が 8 日前に担当しました。 オープンcapability:platform enhancement family:ci family:docs family:issue family:pairing family:pr-management family:release-management family:security family:setup family:tools family:utilities substrate:framework-dev
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
apache/magpie#1497 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Deltares/imod-python#1940 ·
メンテナーはふだん 1 日以内に返信
-
effort: low prio: low ready
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
digitalfabrik/integreat-cms#4621 ·
メンテナーはふだん 5 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
ioos/compliance-checker#1375 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
netbox status: backlog topic: testing type: housekeeping
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
netbox-community/netbox#23395 ·
メンテナーはふだん 1 日以内に返信