[关闭]
@buoge 2017-12-06T17:09:15.000000Z 字数 2945 阅读 1069

写一个体验良好的git commit

程序构建


Done : 结束debug,或是重构,完成了进行中的活动
Debug : 正在对一个文件进行调试
Trim : 表示对一个文件进行整理:空格,函数位置,缩进
Init : 新建分支,会写一个描述,如有任务,附带任务的链接
Fix : fix bug
Mod : remove unused code, 表示修改(Modify)
Add : a new module to have faster process, 表示新增(Add)
Rem : deprecate unused modules, 表示移除(Remove)
Ref : improved the implementation of module X, 表示重构(Refactory)
Branch : 新分支的建立
Dev : 新功能开发中
Merge : 分支合并

  1. Redirect user to the requested page after login
  2. https://trello.com/path/to/relevant/card
  3. Users were being redirected to the home page after login, which is less
  4. useful than redirecting to the page they had originally requested before
  5. being redirected to the login form.
  6. * Store requested path in a session variable
  7. * Redirect to the stored location after successfully logging in the user

Introduce a red/black tree to increase search speed
Remove , which was causing
如果你的修改特别明显,就可以忽略这个。

小提示

使用 fix, add, change 而不是 fixed, added, changed
永远别忘了第2行是空行
用 Line break 来分割提交信息,让它在某些软件里面更容易读
请将每次提交限定于完成一次逻辑功能。并且可能的话,适当地分解为多次小更新,以便每次小型提交都更易于理解。

Examples of good practice:

范例一:

  1. Fix bug where user can't signup.
  2. [Bug #2873942]
  3. Users were unable to register if they hadn't visited the plans
  4. and pricing page because we expected that tracking
  5. information to exist for the logs we create after a user
  6. signs up. I fixed this by adding a check to the logger
  7. to ensure that if that information was not available
  8. we weren't trying to write it.
  9. Redirect user to the requested page after login
  10. https://trello.com/path/to/relevant/card
  11. Users were being redirected to the home page after login, which is less
  12. useful than redirecting to the page they had originally requested before
  13. being redirected to the login form.
  14. * Store requested path in a session variable
  15. * Redirect to the stored location after successfully logging in the user

范例二:

  1. commit 3114a97ba188895daff4a3d337b2c73855d4632d
  2. Author: [removed]
  3. Date: Mon Jun 11 17:16:10 2012 +0100
  4. Update default policies for KVM guest PIT & RTC timers
  5. The default policies for the KVM guest PIT and RTC timers
  6. are not very good at maintaining reliable time in guest
  7. operating systems. In particular Windows 7 guests will
  8. often crash with the default KVM timer policies, and old
  9. Linux guests will have very bad time drift
  10. Set the PIT such that missed ticks are injected at the
  11. normal rate, ie they are delayed
  12. Set the RTC such that missed ticks are injected at a
  13. higher rate to "catch up"
  14. This corresponds to the following libvirt XML
  15. <clock offset='utc'>
  16. <timer name='pit' tickpolicy='delay'/>
  17. <timer name='rtc' tickpolicy='catchup'/>
  18. </clock>
  19. And the following KVM options
  20. -no-kvm-pit-reinjection
  21. -rtc base=utc,driftfix=slew
  22. This should provide a default configuration that works
  23. acceptably for most OS types. In the future this will
  24. likely need to be made configurable per-guest OS type.
  25. Closes-Bug: #1011848
  26. Change-Id: Iafb0e2192b5f3c05b6395ffdfa14f86a98ce3d1f
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注