[Scummvm-devel] Commit message guideline

Max Horn max at quendi.de
Sun Feb 12 04:09:04 CET 2006


Hi folks,


in the past, we haven't talked much if at all about this, but I feel  
I should raise the subject of commit messages and how to make good  
ones...

We are currently not applying any rules here (and we never will be  
able to enforce any, I think :-), but I feel I should at least try to  
make everybody aware of the issue, and give hints to do it better.

The following is an excerpt from the FreeBSD Committer's Guide  
<http://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/ 
article.html> and sums up quite nicely what I think:

<quote>
Good commit messages are important. They tell others why you did the  
changes you did, not just right here and now, but months or years  
from now when someone wonders why some seemingly illogical or  
inefficient piece of code snuck into your source file. It is also an  
invaluable aid to deciding which changes to MFC and which not to MFC.

Commit messages should be clear, concise and provide a reasonable  
summary to give an indication of what was changed and why.

Commit messages should provide enough information to enable a third  
party to decide if the change is relevant to them and if they need to  
read the change itself.

Avoid committing several unrelated changes in one go. It makes  
merging difficult, and also makes it harder to determine which change  
is the culprit if a bug crops up.

Avoid committing style or whitespace fixes and functionality fixes in  
one go. It makes merging difficult, and also makes it harder to  
understand just what functional changes were made. In the case of  
documentation files, it can make the job of the translation teams  
more complicated, as it becomes difficult for them to determine  
exactly what content changes need to be translated.

Avoid committing changes to multiple files in one go with a generic,  
vague message. Instead, commit each file (or small, related groups of  
files) with tailored commit messages.
</quote>.

I'll give some examples. Please understand that I do not mean this  
personal, so if you see yours listed here -- I don't want this to  
tarnish your reputation, I think none of us is "free of sin"  
here :-). I included messages from me, too.


Examples: Commit messages like the following aren't very helpful:
- "not needed"  --> uhm, what is not needed?
- "bye bye" --> was some obsolete code removed? Or did somebody leave  
the project? Or what?
- "Reverse to match values" -> Reverse which values to match what?
- "Move to supported games" -> move what?
- "Forgot *.xpm files" -> forgot what about them?
- "One more file to fix"
- "This difference only applies to SCUMM7+" -> which difference?

Always keep in mind -- those message are often read *without* seeing  
the diffs, and without the possibility to see which other files you  
commited just before that particular commit!

Compare this to
- "Change CVS keywords to SVN keywords"
- "Move Pajama3 to supported games"
- "Added compression tool for kyra speech files."
- "Add patch #1374870 - New Lure of the Temptress module"

Don't be too verbose in your message either. You don't have to tell  
people what the next step in the grand scheme are in a long paragraph  
(hi Erik, I do enjoy your commit messages greatly, don't get me  
wrong :-).


I put all of this into the Wiki, here: <http://wiki.scummvm.org/ 
index.php/Commit-Guidelines>. See also the new work in progress  
"Developer Central": <http://wiki.scummvm.org/index.php/ 
Developer_Central>. You are welcome to make edits to either :-)


Cheers,
Max








More information about the Scummvm-devel mailing list