如何遵循语义版本控制和保持变更日志约定在一起?

How to follow Semantic Versioning and Keep a Changelog conventions together?

Keep a Changelog 是一个广泛使用的约定,它带来了一些关于在 VCS 管理的存储库中维护 CHANGELOG.md 文件的指南。

我怀疑当涉及到一个独特版本的多次提交时它应该如何工作。 由于其文本描述了 “应将相同类型的更改分组” 并且它自己的 repo CHANGELOG.md 文件带来以下内容:

...
## [1.0.0] - 2017-06-20
### Added
- New visual identity by [@tylerfortune8](https://github.com/tylerfortune8).
- Version navigation.
- Links to latest released version in previous versions.
- "Why keep a changelog?" section.
- "Who needs a changelog?" section.
...

然而,同样的准则遵循 Semmantic Versioning 2.0,它定义了:

...
6. Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards compatible bug fixes are introduced. A bug fix is defined as an internal change that fixes incorrect behavior.

7. Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is introduced to the public API. It MUST be incremented if any public API functionality is marked as deprecated. It MAY be incremented if substantial new functionality or improvements are introduced within the private code. It MAY include patch level changes. Patch version MUST be reset to 0 when minor version is incremented.
...

所以我明白每个引入错误修复或新功能的提交都应该分别增加 PATCH 或 MINOR 版本。

这样对吗?

So I understand that each commit that introduces a bug-fix or a new feature should increase the PATCH or MINOR version respectively.

事实并非如此。可能有许多提交导致版本冲突。当您发布更改时,而不是在提交更改时,您会更改版本。请注意,对于某些工作流程,“官方”构建(运行 在 CI/CD 系统上)意味着发布。