finish-hotfix

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Pre-operation Checks

操作前检查

Verify working tree is clean and current branch matches
hotfix/*
per
${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:
  1. If
    $ARGUMENTS
    provided, use it as version (strip 'v' prefix if present)
  2. Otherwise, extract from current branch:
    git branch --show-current
    (strip
    hotfix/
    prefix)
  3. Store clean version without 'v' prefix (e.g., "1.0.1")
目标:从当前分支或参数中确定热修复版本。
操作:
  1. 如果提供了
    $ARGUMENTS
    ,将其用作版本(如果存在则去除'v'前缀)
  2. 否则,从当前分支提取:
    git branch --show-current
    (去除
    hotfix/
    前缀)
  3. 存储不带'v'前缀的干净版本(例如:"1.0.1")

Phase 2: Pre-finish Checks

阶段2:完成前检查

Goal: Run tests before finishing.
Actions:
  1. Identify test commands (check package.json, Makefile, etc.)
  2. Run tests if available; exit if tests fail
目标:完成前运行测试。
操作:
  1. 确定测试命令(检查package.json、Makefile等)
  2. 如果有可用测试则运行;若测试失败则退出

Phase 3: Update Changelog

阶段3:更新变更日志

Goal: Generate changelog from commits.
Actions:
  1. Get previous tag:
    git tag --sort=-v:refname | head -1
  2. Collect commits per
    ${CLAUDE_PLUGIN_ROOT}/references/changelog-generation.md
  3. Update CHANGELOG.md per
    ${CLAUDE_PLUGIN_ROOT}/examples/changelog.md
  4. Commit:
    chore: update changelog for v$VERSION
    with
    Co-Authored-By
    footer
目标:从提交记录生成变更日志。
操作:
  1. 获取上一个标签:
    git tag --sort=-v:refname | head -1
  2. 根据${CLAUDE_PLUGIN_ROOT}/references/changelog-generation.md收集提交记录
  3. 根据${CLAUDE_PLUGIN_ROOT}/examples/changelog.md更新CHANGELOG.md
  4. 提交:
    chore: update changelog for v$VERSION
    ,并添加
    Co-Authored-By
    脚注

Phase 4: Finish Hotfix

阶段4:完成热修复

Goal: Complete hotfix using git-flow-next CLI.
Actions:
  1. Run
    git flow hotfix finish $VERSION --tagname "v$VERSION" -m "Release v$VERSION"
  2. Verify current branch:
    git branch --show-current
    (should be on develop)
  3. Push all:
    git push origin main develop --tags
目标:使用git-flow-next CLI完成热修复。
操作:
  1. 运行
    git flow hotfix finish $VERSION --tagname "v$VERSION" -m "Release v$VERSION"
  2. 验证当前分支:
    git branch --show-current
    (应处于develop分支)
  3. 推送所有内容:
    git push origin main develop --tags