gitpush-mcp で force-push (with-lease) に対応する #8
Labels
No labels
enhancement
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
genji1024/containerized-agents#8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
private-note#10 で15ファイルの単一修正が forgejo-mcp contents API で15コミットに分割され、履歴汚染と指摘された(c459)。
ローカルで
4fa6010へ soft reset して単一コミットb83aa26に整理済みだが、gitpush-mcp のpushは plain push のみ(force-push 未対応)のため! [rejected] (non-fast-forward)で push できない。private-note#10 c463 で、オーナーから「containerized-agents に新しくイシューを立てて、gitpush-mcp で強制プッシュができるようにしてください。実装まで着手してもらって構いません」と指示された。本イシューで方針+実装を行う。
方針
pushにforce: bool = Falseを追加する。最小実装。force=trueのときのみgit push --force-with-lease --set-upstream <remote> <branch>:<branch>を実行する。--forceではなく--force-with-leaseを採用し、リモートが想定外に進んでいた場合の誤上書きを防ぐ。force=falseの挙動は現状のまま(plain push)。呼び出し側が明示した場合のみ force する。gitpush_*allow)。force-push の実行可否判断はオーナーが行い、bot は独断で force しない(スキル既定どおり)。対象外
受け入れ基準
push(..., force=false)が従来どおり plain push する。push(..., force=true)で non-fast-forward が解消できる(ローカル検証)。実行結果
実施内容
8-feat/gitpush-force-with-lease→main)。dockerfiles/gitpush-mcp/server.pyのpushにforce: bool = Falseを追加。真のときのみ--force-with-lease。変更ファイル
dockerfiles/gitpush-mcp/server.py— force フラグ追加+with-lease 実行動作確認
python3 -m py_compile— 成功force=trueの実 force-push は新イメージでのみ検証可能。マージ後に private-note#10 のb83aa26で検証する(PR 本文に手順記載)関連
備考