我们在开发过程中将发行说明记录在 .md 文档中。本文档包含功能说明、迁移说明等。在 merge 功能分支时,我们经常会遇到这个文件中出现冲突的问题,即使通常只添加内容。
特别是,非常烦人的是,在每次完成 merge 请求之后,已经运行的 merge 请求不能再自动 merge ,因为现在在发行说明中再次发生冲突。
我们考虑了不同的解决方案。但是,我们希望避免将发行说明外包到单独的存储库或为每个功能创建单独的文件,然后必须在发布时将其 merge 。
既然我们肯定不是唯一遇到这个问题的人,我们希望我们能得到一些关于如何避免手动 merge 发行说明的有值(value)的提示。
我画了一个问题草图。绿色变化可以自动 merge ,而红色变化需要人工注意。
根据 Lasse Vågsæther Karlsen 的评论进行编辑:
事实上,我们的发行说明确实是这样的:
# Release 5.23.23
## Highlights
### Feature0
A simple explaination in few words targeting non-tec-reader
### Feature1
Another simple explaination in few words targeting non-tec-reader
## New Features
### Feature0
A more detailed explaination targeting other developers. We explain how to use the feature with a small snippet.
### Feature1
Another more detailed explaination targeting other developers. We explain how to use the feature with a small snippet.
## API Changes
### Deprecation of Method `Service#foo`
Feature0 intoduces a better API. `Service#foo` is deprecated as of now and will be removed in a future version
### New Method `QualityService#bar`
This Method replaces `Service#foo` and is way better because of some reason.
如您所见,每个功能都在多个部分中提到。我们已经考虑过构建我们自己的工具,以便在发布期间将多个格式良好的文件 merge 到一个文档中 - 但在为此付出任何努力之前,我们希望确保没有更好的解决方案。
最佳答案
可以在 Git repository itself 中看到生成变更日志的替代方法。
每个功能分支都有一个 merge 提交(like this one),描述功能分支的内容。
发行说明随后会自动更新到 master 分支 ( like this example )
这避免了在多个分支上更新一个公共(public)文件,以及需要管理的复杂 merge 。
关于git - 在 git 中使用 mergerequests 和 releasenotes 时不断发生冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53149757/