| 11 | |
| 12 | === Commit messages === |
| 13 | |
| 14 | General pattern: |
| 15 | |
| 16 | {{{ |
| 17 | module or library: description (possible Trac ticket, merge commit or related commit) |
| 18 | }}} |
| 19 | |
| 20 | Examples (of single line commit messages): |
| 21 | |
| 22 | {{{ |
| 23 | r.to.vect: corrected x in the crowded message |
| 24 | g.mremove: Changed the interface to that of g.mlist and added exclude= (ticket #2228) |
| 25 | libraster: Added raster name and row info to get/put_row error messages |
| 26 | vlib/pg: column check must be case-insensitive |
| 27 | wxGUI/lmgr: add measuring of distances also to Layer Manager |
| 28 | wxGUI: workaround for not visible toolbars on Mac with wxPython 3 |
| 29 | }}} |
| 30 | |
| 31 | Include ticket using hash mark and ticket number, e.g. `#2228`, and another commit (revision) using letter r and revision number, e.g. `r60975`. This will allow Trac (and perhaps other systems) to create a link to the ticket or commit (or revision). However, do not rely on this and always include the information about what and why the commit is changing and how (consider browsing commit messages in command line). |
| 32 | |
| 33 | It is possible and allowed to do multiline commit messages but you should consider the following. First, multiline commit messages should be used to provide further details about the commit. They should not be used to describe large changes of code. Instead, these large changes should be split into the separate commits with shorted commit messages. Note that this not only simplifies writing of good, simple and readable commit messages but it also makes code review and regression testing easier. Second, if you have a lot to say about the commit you should perhaps include this in the comments or documentation (you can refer there to tickets or other commits too in the same way as in commit messages, although they will not be automatically linked). |
| 34 | |
| 35 | Write the commit messages in the way that they can be used to create/update change logs, wiki:Release pages and news in general. |
| 36 | |
| 37 | Don't include your name (or id) to commit message, this is stored separately and automatically. However, if you are committing someone's code (e.g. path) or you are writing the code together with someone, include his or her name. |
| 38 | |
| 39 | Include the module, library or component name as a prefix separated by colon, e.g. `libraster:`. You don't have to include file names in the commit message, they are managed by SVN itself. |
| 40 | |
| 41 | If you are not sure if your style is correct, ask on mailing list. |
| 42 | |
| 43 | Some bad examples (of single line commit messages): |
| 44 | {{{ |
| 45 | wxGUI/render: attempt to fix #560 |
| 46 | (missing information what is #560 and how we are trying to fix it) |
| 47 | |
| 48 | Add tests for Table and Columns classes |
| 49 | (we don't know where the classes belongs to, prefix pygrass: or pythonlib/pygrass would tell us in this case) |
| 50 | |
| 51 | fix bug introduced in r60216 |
| 52 | (missing information how the bug was fixed and which bug it was) |
| 53 | |
| 54 | fix r60216 (i18n) |
| 55 | (it should probably say something like: wxGUI: fix insufficient handling of i18n (introduced in r60216)) |
| 56 | |
| 57 | libraster:Added raster name and row info to get/put_row error messages |
| 58 | (missing space after colon) |
| 59 | }}} |
| 60 | |