- Always have a first line that references the ticket number using # notation.
- Blank space for the second line
- Additional comments after this in whatever format is best.
Fixed feature X by reticulating splines. re #1234
- Reticulated spline for module Y and Z.
- Small other fixes.
- Fixed syntax and unit test issues.
Git treats the first line in a special way, especially for its summary reporting tools. We’re writing scripts using these tools. For example, to see which ticket numbers were completed in what branch, we are grepping the output of git log –pretty=oneline and having that info there would be really great.
Some examples of reasons why this is a good idea: (quoted from this blog post)
git log –pretty=oneline shows a terse history mapping containing the commit id and the summary
git rebase –interactive provides the summary for each commit in the editor it invokes
if the config option merge.summary is set, the summaries from all merged commits will make their way into the merge commit message
git shortlog uses summary lines in the changelog-like output it produces
git format-patch, git send-email, and related tools use it as the subject for emails
reflogs, a local history accessible with git reflog intended to help you recover from stupid mistakes, get a copy of the summary
gitk has a column for the summary
GitHub uses the summary in various places in their user interface