When commiting changesets, I now write my messages using a special format that seems to me “Agile-compatible”. Each line of the message looks like the following: COD Description, where Description is a technical or (as in XOR) client-oriented description of the changeset (the user story summary, for example) and COD is one of:
NEW: a new feature or a new element of source code,IMP: an improvement of one of the features of the projet or of the architecture/source code,FIX: a fix of a bug,REM: a removal of a feature or an element of the project (library, useless files…) -this is rarely used.
The Agile compatibility comes from the fact that if every commit must have a message and every message must follow the format, the commiter/developer can only do changes that can be labeled as a new feature, a fix, a feature removal or a (real) improvement. As an example, rewriting a function can only be a part of a changeset if it improves the project in some way: better performances, better readibility.
Some real world examples:
- the creation of a project is a
NEW Base libraries and build scripts, - the first feature is a
NEW Authentication of a visitor of the website, - a fix of a feature is a
FIX No error message when submitting an empty username in the authentication form, - a change of a feature related to a need is a
IMP Moved the username and password fields on one line, - writing the documentation of a function is a
IMP Documented the password encryption function, - etc.
Finally, using a label per change allows the commiter to have a better view on how to separate the commit in different changesets. Instead of commiting:
FIX PHP error when using a quote in the password field of the authentication form
IMP Getting the user info from the database only once when authentication
The developer can separate the changeset in two different commits (using partial commits or the shelve function of its SCM).
