Commit guidelines
From MapbenderWiki
things to keep in mind when committing a change to SVN. Please stick to these rules, otherwise someone else will have to fix it and might break things. If no one fixes it, the overall quality of the project is decreased.
Contents |
Before an SVN commit
file header
Please use the following template (you can also set up Eclipse to add this template whenever you open a new file).
# $Id$ # http://www.mapbender.org/index.php/<wiki modul page name> # Copyright (C) 2002 CCGIS # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Of course set a link to correct module wiki page (if no wiki page exists, add page and add module documentation)
SVN keywords
Add SVN keywords, if the file is new (If it's not a new file, make sure it has SVN keywords). The $Id$ will be replaced by something meaningful like
$Id: mod_logout.php 2738 2008-08-05 07:59:34Z christoph $
after you've committed the file. In Subclipse, do it like this:
Navigator → right-click the new file → Team → Set Property → Property name: "svn:keywords"; Property Content: "HeadURL Id LastChangedBy LastChangedDate LastChangedRevision"
quality assurance
- follow the code conventions
- use a validator
- Javascript: JSLint
- HTML: W3C HTML Validator
- Please add other validators here
commit message
Please supply a meaningful message. The best way is just to link to a Trac ticket. Image you fixed bug #121. The just add
bug fix: http://trac.osgeo.org/mapbender/ticket/121
as commit message. That's enough.
After an SVN commit
Trac
- After fixing a bug or completing a new feature, go to the bug tracker and close the corresponding issue.
- Add a link to the changeset in the ticket comment, like http://trac.osgeo.org/mapbender/changeset/2766 (This procedure automatically created a patch. Follow the link and click "Unfied Diff" to download it.)
Read more about using Trac.
Wiki
- write or update the module documentation.
- make sure that each module has a Module maintainer.
SVN pre-commit hooks
Some of the above could be done automatically by an SVN pre-commit hook. Let's discuss how this could be achieved at the discussion site.

