Gerrit/Commit message guidelines


 * Please note this article is also transcluded at Git/Workflow.

Commit message guidelines
Crafting the commit message is a very important step of your development work. The message is usually the first thing other developers will see, and the first line in a Git commit-msg has a special meaning. It is considered the "Title" or "Subject" of the commit. Many interfaces use this title to represent the commit, such as:
 * Search results in Gerrit
 * Commit subject in Gitweb
 * Commit history at GitHub
 * Commit subject at GitHub
 * E-mail notifications from Gerrit
 * 's "oneline" mode
 * Release notes of Wikimedia deployment branches of MediaWiki

It is considered useful to the reviewer to have a concise subject identifying the commit. If you can't summarise your commit in a short line, perhaps it is still in a too early phase to submit or maybe it contains too many different things that should be broken up into different commits.

After the subject follows the body of the commit message. The body must be separated from the subject with an empty line. In here put a detailed message fully explaining your patch, what you did, your design choice, possible culprit to look at, any research you have done. Bytes are cheap, so just write! Generally the message body should wrap between 70-100 characters.

If your change will resolve a ticket in Bugzilla, mention the ticket number in the footer like this: Bug: 1234 Gerrit will turn this text into a hyperlink to the bug. It is also indexed this way by Gerrit's search (searching for "bug:45191").

Whenever you refer to another commit, using either the git-commit SHA1 of the merged commit or the Gerrit Change-Id of the change set in Gerrit. Avoid using hyperlinks to refer to commits. If the commit in question has not been merged yet, use the Gerrit Change-Id instead of the git-commit SHA1 as that hash may not end up becoming part of the branch and the reference would potentially be a dead end.

See also:
 * Example commit message
 * http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
 * Git/Introduction
 * http://datamapper.org/using-git.html

Example
jquery.badge: Add ability to display the number zero.

Cupcake ipsum dolor sit. Amet tart cheesecake tiramisu chocolate cake topping. Icing ice cream sweet roll. Biscuit dragée toffee wypas.

I love tootsie roll donut oat cake soufflé. Chupa chups danish carrot cake. I love chocolate candy cookie sesame snaps sesame snaps lollipop carrot cake.

Sweet roll dragée bear claw cheesecake dragée. Icing apple pie macaroon carrot cake I love I love ice cream sweet roll. Brownie powder bonbon marshmallow dessert liquorice I love tiramisu. Follows-up Id5e7cbb1.

Bug: 1237 Change-Id: I88c5f819c42d9fe1468be6b2cf74413d7d6d6907