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

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.lryc.cn/news/576382.html

相关文章:

  • Centos 8设置固定IP
  • Linux通过Crontab实现自启动
  • Grab×亚矩阵云手机:以“云端超级节点”重塑东南亚出行与数字生活生态
  • 第十节:Vben Admin 最新 v5.0 (vben5) 快速入门 - 菜单管理(下)
  • docker部署后端服务的脚本
  • 深入详解:决策树算法的概念、原理、实现与应用场景
  • WHERE 子句中使用子查询:深度解析与最佳实践
  • 设计模式精讲 Day 16:迭代器模式(Iterator Pattern)
  • 如何解决电脑windows蓝屏问题
  • VScode使用usb转网口远程开发rk3588
  • 【龙泽科技】新能源汽车故障诊断仿真教学软件【吉利几何G6】
  • [Linux]从零开始的STM32MP157移植Ubuntu根文件系统教程
  • ubuntu-server 与 ubuntu-live-server 的区别 笔记250628
  • React环境搭建及语法简介
  • Word之空白页删除2
  • 利用GPU加速TensorFlow
  • python多线程详细讲解
  • 【21】C9800配置PSK认证的WLAN
  • 多表连接查询:语法、注意事项与最佳实践
  • 【linux】Vm虚拟机ubuntu的接口ip掉了
  • 电商返利APP架构设计:如何基于Spring Cloud构建高并发佣金结算系统
  • 鸿蒙5:其他布局容器
  • 什么是 PoS(权益证明)
  • LIN总线通讯中的重要概念信号(Signal)、帧(Frame)和 节点(Node)
  • Geollama 辅助笔记:raw_to_prompt_strings_geo.py
  • 鸿蒙5:组件监听和部分状态管理V2
  • 设计模式精讲 Day 17:中介者模式(Mediator Pattern)
  • ASProxy64.dll导致jetbrains家的IDE都无法打开。
  • 医疗标准集中标准化存储与人工智能智能更新协同路径研究(上)
  • LabVIEW液压系统远程监控