英文:
Including issue code in the commit message header according to Conventional Commits
问题
我正在遵循传统提交规范 v1.0.0来管理我的项目,并且我有一个关于在提交消息标题中包含问题代码的问题。假设我有一个代码为 "SPAN-500" 的问题。尽管规范没有明确提到问题代码,但我在网上看到了两种方式:
- 问题代码作为范围(scope)
feat(SPAN-500): 添加功能 X 来改进 Y
- 问题代码作为后缀
feat: 添加功能 X 来改进 Y [#SPAN-500]
我应该如何正确地将问题代码添加到提交消息标题中?
我希望确保我的提交消息遵循推荐的规范并保持一致性。非常感谢任何指导或示例。
谢谢!
英文:
I am following the Conventional Commits guidelines v1.0.0 for my project and I have a question about including the issue code in the commit message header. Let's say I have an issue with code "SPAN-500". Although the specification does not mention issue codes explicitly, I have seen online both:
- Issue code as scope
feat(SPAN-500): add feat X to improve Y
- Issue code as suffix
feat: add feat X to improve Y [#SPAN-500]
How should I properly add the issue code to the commit message header?
I want to ensure that my commit messages follow the recommended conventions and maintain consistency. Any guidance or examples would be greatly appreciated.
Thank you!
答案1
得分: 2
你应该不要将问题代码放在标题中。请遵循示例网站上给出的方式:添加一个额外的页脚,如Refs: #SPAN-500
。
使用“scope”字段来放置问题代码不是一个选项,因为
作用域必须由括号括起来描述代码库中的一部分的名词组成。
而SPAN-500
不是代码库的一部分,而是问题的代码。
英文:
> How should I properly add the issue code to the commit message header?
You should not put the issue code in the header. Follow the example given on the website: Add an additional footer like Refs: #SPAN-500
.
Using the "scope" field to put the issue code is not an option because
> A scope MUST consist of a noun describing a section of the codebase surrounded by parenthesis.
and SPAN-500
is not a section of the codebase but the code of an issue.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论