Difference between revisions of "Commit Guidelines"

Jump to navigation Jump to search
667 bytes added ,  07:21, 29 April 2016
(Update commit guidelines as per Eugene's email on -devel)
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
In the past, we were quite lax about commit messages. Well, we won't start beating people up, but I think we should at least all be aware of the issue at hand; namely, what distinguishes good commit messages from bad ones. I hope that this page will help us all to improve our commit messages a bit... The benefit will be to the full team as commit logs will be more readable.  
This page contains some guidelines about commits and commit messages.


== Rules ==
== Commit guidelines ==
Thus the rules are following (they're standard to git except SUBSYSTEM thing):
 
Commits shouldn't contain multiple unrelated changes; try and make piecemeal changes if you can, to make it easier to review and merge. In particular, don't commit style/whitespace changes and functionality changes in a single commit.
 
If you change shared common code, then (while not necessarily in the same commit, due to the above guideline!) you should also make at least a best-effort attempt to make sure all of the engine/backend code stays working.
 
Assure that ScummVM compiles with every commit. In case of regressions, this helps to track down the commit introducing the regression.
 
== Commit message formatting ==
We won't start beating people up, but everyone should at least all be aware of the issue at hand; namely, what distinguishes good commit messages from bad ones. This page hopes to help all of us to improve our commit messages a bit... The benefit will be to the full team as commit logs will be more readable.
 
The rules on commit messages are the following (they're standard to git, except our SUBSYSTEM requirement):
<pre>
<pre>
SUBSYSTEM: Short (50 chars or less) summary of changes
SUBSYSTEM: Short (50 chars or less) summary of changes
Line 27: Line 37:
</pre>
</pre>


Particularly the critical is the first line. You may noticed that several developers already started to use this scheme, particularly take a look at Max's or Eugene's commits. This first line is used in short log format, and providing engine name, sound subsystem, backend name or whatever lets decide quickly should reviewers look deeply into commit or skip.
Particularly critical is the first line: This first line is used in short log format, and providing engine name, sound subsystem, backend name or whatever lets decide quickly should reviewers look deeply into commit or skip.


The subsystem names which were used so far:
The subsystem names which were used so far:
* '''AGOS''', '''SCI''', '''SCUMM''', whatever engine name
* '''AGOS''', '''SCI''', '''SCUMM''', whatever engine name
* '''SDL''', '''Android''', '''WII''', '''NDS''', whatever backend name
* '''SDL''', '''ANDROID''', '''WII''', '''NDS''', whatever backend name
* '''OSystem''': our middleware code
* '''OSYSTEM''': our middleware code
* '''i18n''': internationalization
* '''I18N''': internationalization
* '''GUI''': all gui-related
* '''GUI''': all gui-related
* '''TOOLS''': ScummVM tools module or built-in tools
* '''TOOLS''': ScummVM tools module or built-in tools
* '''MIDI''': MIDI sound-related
* '''MIDI''': MIDI sound-related
* '''ALL''': A change that covers multiple, or all, subsystems
* '''JANITORIAL''': Cross-subsystem cleanups and formatting changes


After first line there has to be an empty line which is used as separator, and also this first line has to be short, less than 50 characters, so log will fit on standard 80 columns terminal.
After first line, an empty line is required which is used as separator. This first line has to be short and less than 50 characters so the log will fit on a standard 80-column terminal.


== Good Practice ==
== Commit messages ==
Commit messages like the following aren't very helpful:
Commit messages like the following aren't very helpful:
* "not needed"  -> uhm, what is not needed?
* "not needed"  -> uhm, what is not needed?
Line 51: Line 63:
* "" -> empty commit messages are about the worst you can do :-/ (short of insults and totally offtopic messages).
* "" -> empty commit messages are about the worst you can do :-/ (short of insults and totally offtopic messages).


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!
Always keep in mind -- those message are often read *without* seeing the diffs, and without the possibility to see which other files you committed just before that particular commit!


Compare this to
Compare this to
Line 59: Line 71:
* "Add patch #1374870 - New Lure of the Temptress module"
* "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.
Don't be too verbose in your message either. You don't have to tell people what the next step in the grand scheme is in a long paragraph.




81

edits

Navigation menu