ds-revive
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUpdate the idea, not only the branch. A clean rebase does not prove the PR still belongs.
要更新的是构想,而不只是分支。干净的 rebase 并不能证明 PR 仍然适用。
Steps
步骤
- Fetch the latest base, the PR head and any related branches.
- Record the PR URL, state, base, head branch, head SHA, author, checks and review state. Read the title, body, linked issues, commits, threads and full diff.
- Write the PR's goal in one sentence.
- Find the merge base. Read what landed on the base branch since then. Search merged and open PRs for the same problem.
- Answer each question with evidence (commit, PR or file path):
- Has this problem already been solved?
- Did the APIs, types, schemas or structure it relies on change?
- Was the code it edits moved, deleted or simplified?
- Would landing it bring back old behavior or make two ways to do one thing?
- Is the benefit still worth the upkeep?
- Pick one verdict:
- REVIVE: goal and shape still fit. Go to step 7.
- REWORK: goal fits, shape does not. Describe the smallest rewrite and stop, unless the user also asked for the rework.
- CLOSE: superseded or no longer worth it. Cite the evidence and stop. Do not close it yourself.
- For REVIVE: work in a clean worktree at the recorded head. Rebase onto the fresh base. Resolve conflicts by the PR's goal and the base's newer rules.
- Run on the old and new series. Confirm no intended change was lost and nothing already landed came back.
git range-diff - Run the focused checks for the touched area. Mark each failure as real, pre-existing or infrastructure.
- Push with .
--force-with-lease=<branch>:<old head SHA> - Report the verdict first, then base changes, conflicts, push result, checks and the remaining decision with the PR link.
- 获取最新的 base、PR head 以及任何相关分支。
- 记录 PR URL、状态、base、head 分支、head SHA、作者、检查结果和 review 状态。阅读标题、正文、关联 issue、commits、讨论串和完整 diff。
- 用一句话写出 PR 的目标。
- 找到 merge base。阅读此后合并到 base 分支的内容。搜索已合并和仍开放的 PR,确认是否存在相同问题。
- 使用证据(commit、PR 或文件路径)回答每个问题:
- 这个问题是否已经解决?
- 它依赖的 API、类型、schema 或结构是否发生了变化?
- 它修改的代码是否被移动、删除或简化?
- 合并它是否会恢复旧行为,或导致同一件事出现两种实现方式?
- 它带来的收益是否仍然值得持续维护?
- 选择一种结论:
- REVIVE:目标和实现形式仍然适用。进入步骤 7。
- REWORK:目标仍然适用,但实现形式不再适用。描述最小改写方案并停止,除非用户同时要求完成 rework。
- CLOSE:该 PR 已被取代,或已不再值得继续。引用相关证据并停止。不要自行关闭它。
- 对于 REVIVE:在干净的 worktree 中基于记录的 head 操作。将其 rebase 到最新的 base 上。发生冲突时,应依据 PR 的目标和 base 中较新的规则解决。
- 对旧提交序列和新提交序列运行 。确认没有丢失预期变更,也没有让已经合并的内容重新出现。
git range-diff - 针对受影响区域运行重点检查。将每项失败标记为真实问题、既有问题或基础设施问题。
- 使用 推送。
--force-with-lease=<branch>:<old head SHA> - 首先报告结论,然后报告 base 变更、冲突、推送结果、检查结果、尚待决定的事项以及 PR 链接。
Stop when
在以下情况下停止
- The report is written after any of the three verdicts.
- A conflict shows a product or design disagreement. Stop and reconsider the verdict.
- The lease fails. Fetch again and redo steps 4 to 6 once. If it fails again, report.
- 在三种结论中的任意一种得出后,报告即告完成。
- 冲突体现了产品或设计层面的分歧。停止操作并重新评估结论。
- lease 失败。再次 fetch,然后重新执行步骤 4 至 6。如果再次失败,则进行报告。
Rules
规则
- Treat a dirty worktree as the user's. Never stash or discard it.
- Never merge, close or change the base branch. Never force-push without a lease.
- No conflicts in Git does not mean the PR is current.
- Separate facts you checked from your judgment.
- Post PR comments only when asked, through .
ds-pr-comments
- 将 dirty worktree 视为用户的工作区。绝不要 stash 或丢弃其中的内容。
- 绝不要 merge、close 或修改 base 分支。绝不要在没有 lease 的情况下 force-push。
- Git 中没有冲突并不意味着 PR 仍然适用。
- 将已核实的事实与个人判断区分开来。
- 仅在用户明确要求时,通过 发布 PR 评论。
ds-pr-comments