finish-hotfix
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePre-operation Checks
操作前检查
Verify working tree is clean and current branch matches per .
hotfix/*${CLAUDE_PLUGIN_ROOT}/references/invariants.md根据${CLAUDE_PLUGIN_ROOT}/references/invariants.md,验证工作区是否干净,且当前分支匹配。
hotfix/*Phase 1: Identify Version
阶段1:确定版本
Goal: Determine hotfix version from current branch or argument.
Actions:
- If provided, use it as version (strip 'v' prefix if present)
$ARGUMENTS - Otherwise, extract from current branch: (strip
git branch --show-currentprefix)hotfix/ - Store clean version without 'v' prefix (e.g., "1.0.1")
目标:从当前分支或参数中确定热修复版本。
操作:
- 如果提供了,将其用作版本(如果存在则去除'v'前缀)
$ARGUMENTS - 否则,从当前分支提取:(去除
git branch --show-current前缀)hotfix/ - 存储不带'v'前缀的干净版本(例如:"1.0.1")
Phase 2: Pre-finish Checks
阶段2:完成前检查
Goal: Run tests before finishing.
Actions:
- Identify test commands (check package.json, Makefile, etc.)
- Run tests if available; exit if tests fail
目标:完成前运行测试。
操作:
- 确定测试命令(检查package.json、Makefile等)
- 如果有可用测试则运行;若测试失败则退出
Phase 3: Update Changelog
阶段3:更新变更日志
Goal: Generate changelog from commits.
Actions:
- Get previous tag:
git tag --sort=-v:refname | head -1 - Collect commits per
${CLAUDE_PLUGIN_ROOT}/references/changelog-generation.md - Update CHANGELOG.md per
${CLAUDE_PLUGIN_ROOT}/examples/changelog.md - Commit: with
chore: update changelog for v$VERSIONfooterCo-Authored-By
目标:从提交记录生成变更日志。
操作:
- 获取上一个标签:
git tag --sort=-v:refname | head -1 - 根据${CLAUDE_PLUGIN_ROOT}/references/changelog-generation.md收集提交记录
- 根据${CLAUDE_PLUGIN_ROOT}/examples/changelog.md更新CHANGELOG.md
- 提交:,并添加
chore: update changelog for v$VERSION脚注Co-Authored-By
Phase 4: Finish Hotfix
阶段4:完成热修复
Goal: Complete hotfix using git-flow-next CLI.
Actions:
- Run
git flow hotfix finish $VERSION --tagname "v$VERSION" -m "Release v$VERSION" - Verify current branch: (should be on develop)
git branch --show-current - Push all:
git push origin main develop --tags
目标:使用git-flow-next CLI完成热修复。
操作:
- 运行
git flow hotfix finish $VERSION --tagname "v$VERSION" -m "Release v$VERSION" - 验证当前分支:(应处于develop分支)
git branch --show-current - 推送所有内容:
git push origin main develop --tags