keep-a-changelog

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

keep-a-changelog

keep-a-changelog

Add a new version entry to
CHANGELOG.md
, or restructure the entire file, following the Keep a Changelog format and Semantic Versioning.
CHANGELOG.md
添加新版本条目,或者重构整个文件,遵循Keep a Changelog格式和Semantic Versioning规范。

Workflow — new version entry

工作流 — 新增版本条目

  1. Read
    CHANGELOG.md
    to identify the last released version and its date.
  2. Run
    git log --oneline <last-tag>..HEAD
    to list all commits since that tag. If no tag exists for the last version, use
    git log --oneline
    and filter manually.
  3. Run
    date +%Y-%m-%d
    to get today's release date — never hardcode it.
  4. Determine the new version number (ask the user if not specified):
    • MAJOR bump: breaking changes or major redesign.
    • MINOR bump: new features, backward-compatible.
    • PATCH bump: bug fixes only.
  5. Group commits into Keep a Changelog sections (see Section rules below).
  6. Prepend the new version block immediately after the file header (before the previous latest version).
  7. Do NOT remove or alter any existing version entries.
  1. 读取
    CHANGELOG.md
    以确定上一个已发布版本及其发布日期。
  2. 执行
    git log --oneline <last-tag>..HEAD
    列出该标签之后的所有提交。如果上一个版本没有对应的标签,使用
    git log --oneline
    并手动筛选。
  3. 执行
    date +%Y-%m-%d
    获取今日发布日期 — 不要硬编码日期。
  4. 确定新版本号(如果未指定则询问用户):
    • MAJOR版本升级:包含破坏性变更或重大重构。
    • MINOR版本升级:新增向后兼容的功能。
    • PATCH版本升级:仅包含Bug修复。
  5. 将提交归类到Keep a Changelog对应的板块中(见下方板块规则)。
  6. 将新版本块添加到文件头之后的最靠前位置(在上一个最新版本之前)。
  7. 不要删除或修改任何已有的版本条目。

Workflow — restructure entire CHANGELOG.md

工作流 — 重构整个CHANGELOG.md

  1. Read the full
    CHANGELOG.md
    and note all existing version blocks.
  2. Rewrite the file preserving all versions and dates but enforcing:
    • Correct header and intro paragraph (see File header below).
    • Consistent section names and ordering.
    • Bullet style: start each item with a capital letter, no trailing period.
  3. Run
    date +%Y-%m-%d
    and confirm the latest version date is still accurate.
  1. 读取完整的
    CHANGELOG.md
    ,记录所有现有的版本块。
  2. 重写文件,保留所有版本和日期,但需满足以下要求:
    • 正确的文件头和介绍段落(见下方文件头)。
    • 统一的板块名称和排序。
    • 列表项格式:每个条目首字母大写,末尾不加句号。
  3. 执行
    date +%Y-%m-%d
    ,确认最新版本的日期仍然准确。

File header

文件头

markdown
undefined
markdown
undefined

Changelog

Changelog

All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
undefined
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
undefined

Version block format

版本块格式

markdown
undefined
markdown
undefined

[X.Y.Z] - YYYY-MM-DD

[X.Y.Z] - YYYY-MM-DD

Added

Added

  • ...
  • ...

Changed

Changed

  • ...
  • ...

Fixed

Fixed

  • ...

Omit any section that has no entries. Do not add empty sections.
  • ...

没有内容的板块请省略,不要添加空板块。

Section rules

板块规则

Use only these standard Keep a Changelog section names, in this order when multiple sections are present:
SectionWhen to use
Added
New features or capabilities
Changed
Changes to existing behavior
Deprecated
Features marked for future removal
Removed
Features removed in this release
Fixed
Bug fixes
Security
Security-related fixes or improvements
当存在多个板块时,使用以下标准Keep a Changelog板块名称,并按照如下顺序排列:
板块名适用场景
Added
新增功能或能力
Changed
对现有行为的修改
Deprecated
标记为未来会移除的功能
Removed
本版本中移除的功能
Fixed
Bug修复
Security
与安全相关的修复或优化

Commit → section mapping heuristics

提交信息到板块的映射规则

  • feat:
    /
    add
    /
    new
    Added
  • refactor:
    /
    change
    /
    rename
    /
    move
    /
    update
    /
    improve
    Changed
  • fix:
    /
    bug
    /
    patch
    Fixed
  • remove:
    /
    delete
    /
    drop
    Removed
  • deprecate:
    Deprecated
  • security:
    /
    cve
    /
    vuln
    Security
  • docs:
    /
    chore:
    /
    ci:
    /
    test:
    — omit unless user-facing.
When a commit message is ambiguous, infer intent from the diff or file name.
  • feat:
    /
    add
    /
    new
    Added
  • refactor:
    /
    change
    /
    rename
    /
    move
    /
    update
    /
    improve
    Changed
  • fix:
    /
    bug
    /
    patch
    Fixed
  • remove:
    /
    delete
    /
    drop
    Removed
  • deprecate:
    Deprecated
  • security:
    /
    cve
    /
    vuln
    Security
  • docs:
    /
    chore:
    /
    ci:
    /
    test:
    — 除非是面向用户的变更,否则省略。
当提交信息含义不明确时,从diff内容或文件名推断变更意图。

Style rules

格式规则

  • Write in English throughout.
  • Each bullet: capital letter, present tense, no trailing period. Example:
    Add retry logic for HTTP requests
  • Keep bullets concise — one line per entry where possible.
  • Wrap code identifiers, file paths, and module names in backticks.
  • Never guess dates — always use
    date +%Y-%m-%d
    .
  • 全程使用英文编写。
  • 每个列表项:首字母大写,使用一般现在时,末尾不加句号。示例:
    Add retry logic for HTTP requests
  • 保持列表项简洁 — 尽可能每个条目只占一行。
  • 代码标识符、文件路径、模块名称使用反引号包裹。
  • 绝对不要猜测日期 — 始终使用
    date +%Y-%m-%d
    获取。