This is an old revision of the document!
This document provides guidelines on how to write a well-formed commit message when developing for MantisBT.
See below for further details
git commit -s)
Remember to give credit when it's due (
git commit –author= or at least a reference in the description)
This is somewhat out of scope of this document, but nevertheless related information, so here goes.
Remember that each commit should cover only one single logical/functional change.
A good commit message should basically answer three questions about a patch:
The Summary line is used all over Git, oftentimes in truncated form if it is too long. It should be kept under 50 characters if possible, but no more than 72 characters long.
Using a long Summary may make it more difficult to understand what the commit is about when using one of the below (and other) commands.
Examples of where it ends up:
git log –pretty=onelineshows a terse history mapping containing the commit id and the summary
git rebase –interactiveprovides the summary for each commit in the editor it invokes
git format-patch, git send-email, and related tools use it as the subject for emails
git reflog, provides a local history intended to help recovery from stupid mistakes
Remember to always add a blank line between Summary and Description.
git logdoesn’t do any special special wrapping of the commit messages.
less -S, this means long lines will flow far off the edge of the screen, making them difficult to read. On an 80 column terminal, if we subtract 4 columns for the indent on the left and 4 more for symmetry on the right, we’re left with 72 columns.
git format-patch –stdoutgenerates emails from commits using the Description for the message body.
The commit's Description should be as long as necessary, and must provide
Bug[s]|Issue[s]|Report[s] IssueList– reference the listed issue(s), e.g
Fix[ed|es]|Resolve[d|s] IssueList– reference and automatically resolve the listed issue(s), e.g.
Fixes #1234, #5678
Make sure that another person can understand what you wrote, and that you would also if going back to it 6 months down the line.
*as bullets), add blank lines between bullets to improve clarity
- bullet 1 - bullet 2 some additional text - bullet 3