User Tools

  • Logged in as: anonymous (anonymous)
  • Log Out

Site Tools


mantisbt:git_commit_messages

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mantisbt:git_commit_messages [2014/05/28 05:10]
dregad
mantisbt:git_commit_messages [2018/02/06 08:35] (current)
dregad [Checklist] Bug reference examples
Line 25: Line 25:
     * Description must be **understandable** for everyone     * Description must be **understandable** for everyone
   - **Bug reference**   - **Bug reference**
-    * Optional, but most commits should reference an issue in the [[http://​mantisbt.org/​bugs|bugtracker]],​ formatted for use by the **Source Integration** plugin+    * Optional, but most commits should reference an issue in the [[http://​mantisbt.org/​bugs|bugtracker]],​ formatted for use by the **Source Integration** plugin ​\\ e.g. ''​Fixes #​1234'',​ ''​Issues #123, #​456''​
   - **Sign-off** if the commit'​s author is not a MantisBT core developer   - **Sign-off** if the commit'​s author is not a MantisBT core developer
  
Line 82: Line 82:
  
   * **vi/vim** <​code>​$ git config --global core.editor "vi -c ':set textwidth=72'"</​code>​ and use the ''​gq''​ command to reflow the text, e.g. ''​gqG''​ from current line to end of file   * **vi/vim** <​code>​$ git config --global core.editor "vi -c ':set textwidth=72'"</​code>​ and use the ''​gq''​ command to reflow the text, e.g. ''​gqG''​ from current line to end of file
 +
 +
 +
  
 ==== Description ==== ==== Description ====
 +
 +=== Contents ===
  
 The commit'​s Description should be as long as necessary, and in terms of contents, must  The commit'​s Description should be as long as necessary, and in terms of contents, must 
Line 98: Line 103:
   * give **credit** to the original author. \\ Use ''​git commit --author='',​ or at least name the person in the text.   * give **credit** to the original author. \\ Use ''​git commit --author='',​ or at least name the person in the text.
  
-  * be **signed off** by the committer if different from author ​\\ Use ''​git commit ​-s''​+  * be **signed off** by the committer if different from author ​(see [[git_commit_messages#​sign-off|below]])
  
-With regards to formatting+=== Formatting ===
  
   * Separate paragraphs with 2 newlines   * Separate paragraphs with 2 newlines
Line 110: Line 115:
 </​code>​ </​code>​
  
 +=== Sign-off ===
  
 +When committing changes submitted by non-core team members, the commit must be signed off by the committer in the case of individual commits (use ''​git commit -s''​).
 +This is not necessary when merging several commits as a feature branch, as the merge commit itself will serve as sign off.
  
 ===== Examples ===== ===== Examples =====
Line 146: Line 154:
 Signed-off-by:​ Core Developer <​coredev@mantisbt.org>​ Signed-off-by:​ Core Developer <​coredev@mantisbt.org>​
 </​code>​ </​code>​
 +
  
 ===== References ===== ===== References =====
Line 155: Line 164:
   * [[https://​wiki.openstack.org/​wiki/​GitCommitMessage|OpenStack'​s GIT Commit Good Practice]]   * [[https://​wiki.openstack.org/​wiki/​GitCommitMessage|OpenStack'​s GIT Commit Good Practice]]
   * [[http://​who-t.blogspot.de/​2009/​12/​on-commit-messages.html|Who-T blog on commit messages]]   * [[http://​who-t.blogspot.de/​2009/​12/​on-commit-messages.html|Who-T blog on commit messages]]
 +  * [[http://​chris.beams.io/​posts/​git-commit/​|How to Write a Git Commit Message?]]
 +
 +===== To do =====
 +
 +Grangeway suggested to implement a commit hook to perform validation on commit message, e.g.
 +http://​addamhardy.com/​blog/​2013/​06/​05/​good-commit-messages-and-enforcing-them-with-git-hooks/​
  
mantisbt/git_commit_messages.1401268207.txt.gz ยท Last modified: 2014/05/28 05:24 (external edit)