TDD& Git提交评论

时间:2013-09-26 20:44:51

标签: git tdd commit

我在项目中使用TDD 我写了一个测试,看着它失败,编写代码使其变为绿色并与Git一起提交 我已经阅读了有关提交第一次开发的内容,但我不明白如何使用此工作流程 如果我正在测试应用程序的一个层(如服务或存储库),我应该在提交中写什么样的注释,以便对其他人好看?
我应该写下测试的名字吗? 你是怎么处理的?

1 个答案:

答案 0 :(得分:0)

TDD变更的提交应与其他任何变更无异。因此,您对提交消息应用相同的规则。

这是an example from tpope

  

Capitalized, short (50 chars or less) summary

     

More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); tools like rebase can get confused if you run the two together.

     

Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug." This convention matches up with commit messages generated by commands like git merge and git revert.

     

Further paragraphs come after blank lines.

     

- Bullet points are okay, too

     

- Typically a hyphen or asterisk is used for the bullet, preceded by a single space, with blank lines in between, but conventions vary here

     

- Use a hanging indent