wiki:Documentation/UserGuide/CommitOnTrunk

Version 15 (modified by bguenet, 4 years ago) (diff)

--

Guidelines and help to commit on the trunk (or a branch)

Author: B. Guenet
Last revision: 2020/02/28, B. Guenet

Here are some general guidelines for committing into the trunk ORCHIDEE. These recommendations can also be applied to branches and other versions under SVN control.

Before commit:

  • the code must be conform to the ORCHIDEE coding guidelines (Documentation/UserGuide/CodingGuidelines)
  • update to latest version: the modifications must be integrated in the latest version of the trunk (use "svn update", or extract a new ORCHIDEE). Be sure that your original code is backup somewhere locally to avoid deleting developments during the update.
  • if svn update induce some conflicts between your local version and the trunk version carefully check them and solve them manually if necessary. Don't forget then, once the conflicts are resolved, to do "svn resolved myfile.f90"
  • the modifications must be tested on at least one platform using MPI parallelism (except if only comments are changed). This means that you should launch a test simulation on more than one processor.
  • check difference in results from your history files. The reason for a change in result must be known before the commit. If possible, avoid change in results except if it was on purpose.
  • communicate and/or be aware of the latest news in the ORCHIDEE core team. For example a colleague announced that she/he will make a commit, better wait or ask if you could commit before.

Some cases must be discussed in advance:

  • if the behaviour of the model change. For example: change in parameter name in getin function, change in default value for some parameters, etc..
  • if the interface towards the atmosphere is changed
  • structural modifications

During commit:

  • a commit should only resolve one problem at a time, related to one ticket.
  • write a useful log message in English
  • Within this log message, use #X to refer to the ticket number X (the # will make a link directly to the ticket when visualizing the log message on the web)

After commit:

  • for important changes, make a note here: SourceCode
  • tell the project group if the results changed even for tiny changes. A new reference must then be done in the trusting.
  • if related to a ticket, add a link to the commit in the ticket using [Y], where Y is the revision number on the commit. Close the ticket if all questions are treated.

Basic use of SVN

See also the section svn on the Documentation/UserGuide.

Create a new file

Add a new file to the svn repository either by coping an existent, renaming or adding a new file.

> svn cp file1 file2
or
> svn mv file1 file2
or create first the file2 and then add it
> svn add file2

All these commands will only add locally the file. To finally add them to the repository you must commit:

> svn -u stat
> svn ci

Activate revision information

If you added a new file, make sure also to activate the commit information in the header, after activation this should be done automatically at each commit. Add in the beginning of the file the following keywords :

!! $HeadURL$
!! $Date$
!! $Revision$

Activate substitution by using propset and commit the file:

> svn propset svn:keywords "Date Revision HeadURL" file2.f90
> svn ci file2.f90

After the commit it should look something like:

!! $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/trunk/ORCHIDEE/src_sechiba/file2.f90 $
!! $Date: 2015-09-21 13:37:38 +0200 (lun. 21 sept. 2015) $
!! $Revision: 2928 $