当前位置: 首页 > ds >正文

AngularJS Git 提交消息规范

目标

  • 脚本化生成 CHANGELOG.md
  • 识别不重要的提交
  • 在浏览历史记录时提供更多信息

提交消息的格式

提交消息由标题正文脚注组成,各部分之间用一个空行隔开。

<type>(<scope>): <subject><body><footer>

提交消息的任何一行都不能超过 100 个字符!这使得消息在 GitHub 和各种 Git 工具中更容易阅读。


Revert (回滚)

如果提交是回滚之前的提交,其标题应以 revert: 开头,后跟被回滚提交的标题。在正文中,应写明:This reverts commit <hash>.,其中 hash 是被回滚提交的 SHA 值。


消息标题

消息标题是单行,包含对更改的简洁描述,包括类型、可选范围和主题。

允许的 <type>

这描述了此提交提供的更改类型:

  • feat (新功能)
  • fix (bug 修复)
  • docs (文档)
  • style (格式化,缺少分号等)
  • refactor (重构)
  • test (添加缺失的测试)
  • chore (维护)

允许的 <scope>

范围可以是指定提交更改位置的任何内容。例如:$location$browser$compile$rootScopengHrefngClickngView 等。

如果没有更合适的范围,可以使用 *

<subject> 文本

这是对更改的非常简短的描述。

  • 使用祈使句,现在时态:“change”而不是“changed”或“changes”
  • 首字母不要大写
  • 末尾没有点号 (.)

消息正文

<subject> 一样,使用祈使句,现在时态:“change”而不是“changed”或“changes”。

包括更改的动机以及与先前行为的对比。

  • http://365git.tumblr.com/post/3308646748/writing-git-commit-messages
  • http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

消息脚注

Breaking changes (破坏性更改)

所有破坏性更改都必须在脚注中作为破坏性更改块提及,该块应以“BREAKING CHANGE:”开头,后跟一个空格或两个换行符。提交消息的其余部分是对更改的描述、理由和迁移说明。

BREAKING CHANGE: isolate scope bindings definition has changed andthe inject option for the directive controller injection was removed.To migrate the code follow the example below:Before:scope: {myAttr: 'attribute',myBind: 'bind',myExpression: 'expression',myEval: 'evaluate',myAccessor: 'accessor'}After:scope: {myAttr: '@',myBind: '@',myExpression: '&',// myEval - usually not useful, but in cases where the expression is assignable, you can use '='myAccessor: '=' // in directive's template change myAccessor() to myAccessor}The removed `inject` wasn't generaly useful for directives so there should be no code using it.

Referencing issues (引用问题)

已关闭的 bug 应在脚注中单独列出,并以“Closes”关键字作为前缀,如下所示:

Closes #234

或者在涉及多个问题时:

Closes #123, #245, #992


示例

feat($browser): onUrlChange event (popstate/hashchange/polling)Added new event to $browser:
- forward popstate event if available
- forward hashchange event if popstate not available
- do polling when neither popstate nor hashchange availableBreaks $browser.onHashChange, which was removed (use onUrlChange instead)
fix($compile): couple of unit tests for IE9Older IEs serialize html uppercased, but IE9 does not...
Would be better to expect case insensitive, unfortunately jasmine does
not allow to user regexps for throw expectations.Closes #392
Breaks foo.bar api, foo.baz should be used instead
feat(directive): ng:disabled, ng:checked, ng:multiple, ng:readonly, ng:selectedNew directives for proper binding these attributes in older browsers (IE).
Added coresponding description, live examples and e2e tests.Closes #351
style($location): add couple of missing semi colons
docs(guide): updated fixed docs from Google DocsCouple of typos fixed:
- indentation
- batchLogbatchLog -> batchLog
- start periodic checking
- missing brace
feat($compile): simplify isolate scope bindingsChanged the isolate scope binding options to:- @attr - attribute binding (including interpolation)- =model - by-directional model binding- &expr - expression execution bindingThis change simplifies the terminology as well as
number of choices available to the developer. It
also supports local name aliasing from the parent.BREAKING CHANGE: isolate scope bindings definition has changed and
the inject option for the directive controller injection was removed.To migrate the code follow the example below:Before:scope: {myAttr: 'attribute',myBind: 'bind',myExpression: 'expression',myEval: 'evaluate',myAccessor: 'accessor'
}After:scope: {myAttr: '@',myBind: '@',myExpression: '&',// myEval - usually not useful, but in cases where the expression is assignable, you can use '='myAccessor: '=' // in directive's template change myAccessor() to myAccessor
}The removed `inject` wasn't generaly useful for directives so there should be no code using it.
http://www.xdnf.cn/news/14840.html

相关文章:

  • VS Code 配置本地 Dev Container
  • (LeetCode 每日一题) 2099. 找到和最大的长度为 K 的子序列 (排序)
  • 翻译服务器
  • SpringMVC系列(七)(Restful架构风格(下))(完结篇)
  • 第一章 从零开始学习大型语言模型-搭建环境
  • Spring Cloud:微服务架构的基石与实践指南
  • 从0开始学习计算机视觉--Day04--损失函数
  • C++动态链接库之非托管封装Invoke,供C#/C++ 等编程语言使用,小白教程——C++动态链接库(一)
  • Linux系统(信号篇)信号的保存
  • 在反向代理环境下精准获取客户端真实 IP 的最佳实践
  • Vue样式绑定与条件渲染详
  • 玄机抽奖Spring Web项目
  • 【STM32 学习笔记】PWR电源控制
  • 高通手机跑AI系列之——穿衣试装算法
  • 数据结构进阶 - 第一章 绪论
  • 数据结构-第三节-树与二叉树
  • 什么是财务共享中心?一文讲清财务共享建设方案
  • Lynx vs React Native vs Flutter 全面对比:三大跨端框架实测分析
  • 人大金仓Kingbase数据库KSQL 常用命令指南
  • Python文件操作完全指南:从入门到精通
  • 广州华锐互动:技术与创意双驱动的 VR 先锋​
  • LightGBM:极速梯度提升机——结构化数据建模的终极武器
  • 柔性制造企业数字化系统建设方案(PPT)
  • LVS-NAT负载均衡群集实战:原理、部署与问题排查
  • 逆向入门(8)汇编篇-rol指令的学习
  • Boss:攻击
  • IoT/HCIP实验-5/基于NB-IoT的智慧农业实验(平台侧开发+端侧编码+基础调试分析)
  • 数据驱动的农产品供应链管理:让“菜篮子”更智慧、更高效
  • aspose.word在IIS后端DLL中高并发运行,线程安全隔离
  • 【Lua 基础学习】