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



Keep a Changelog是一种广泛使用的约定,它为在VCS管理的存储库中维护CHANGELOG.md文件提供了一些指导。

当涉及到一个独特版本的多次提交时,我不知道它应该如何工作。由于其文本描述了";相同类型的改变应该被分组为">及其自己的repoCHANGELOG.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,该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版本。

这是对的吗?

因此,我理解每一次引入错误修复或新功能的提交都应该分别增加PATCH或MINOR版本。

这不是真的。可能会有许多提交导致版本冲突。发布更改时,而不是提交更改时,会更改版本。注意,对于一些工作流;官方的";构建(在CI/CD系统上运行(意味着发布。

最新更新