chore(scripts): safe-worktree.sh — 防 stale baseline 白工守門 - #450
Merged
Conversation
- 一律以 origin/<base> 最新 tip 建立 worktree,過期本地分支無法成為起點 - fetch --all --prune + 本地/遠端 SHA 一致性檢查,落後時警告 - 根治多次從過期分支開 worktree 導致 PR 白工的事故(Codex/Cursor review Q2) 測試:bash -n 語法檢查通過;功能測試從 origin/main tip 建立並驗證 SHA 一致
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
|
✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cec3af0541
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Codex + Cursor 三方 review(Q2)一致最高信心建議:把「branch 起點機械化驗證」固化成守門,根治多次 stale-baseline 白工(例:被 #445 取代的 cluster PR、被吞併的 #444)。
內容
scripts/safe-worktree.sh <new-branch> <worktree-path> [base-branch]:git fetch --all --prune後,一律以origin/<base>最新 tip 為基準建立 worktree → 過期本地同名分支在物理上無法成為起點。驗證
bash -n語法檢查通過;功能測試從origin/maintip 建立並驗證 HEAD SHA 一致、清理成功。🤖 Generated with Claude Code