CVS Best Practices

From GEOS-5
Revision as of 06:41, 29 November 2012 by Mathomp4 (talk | contribs) (Cut-and-paste from doc in SI Team CVS)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Guidelines for Branching the Model

======================

Style of branch names:

  - We recommend using b_XYZ_descriptive where XYZ are your initials
    and "descriptive" is a descriptive name for your branch
  - Note: With GEOS-5 we do not branch the entire model. Rather we branch
    individual files that are edited. There may be special circumstances
    when branching an entire directory (say, a leaf Gridded Component)
    might be correct, but this should only be done with approval.

To branch your modified file on a new branch:

  You've made modifications to file.F90 and want to save these to a new
  branch of the model. To do so:
  1. Tag the root of your new branch with:
     cvs tag b_XYZ_descriptive_ROOT file.F90
     [ What this does is tag where your branch came from to allow
       for easy tracing of your modifications. ]
  2. Create a branch relative to that tag:
     cvs tag -r b_XYZ_descriptive_ROOT -b b_XYZ_descriptive file.F90
     [ This says relative to that ROOT, create a branch of name
       b_XYZ_descriptive. ]
  3. Update your file to your new branch:
     cvs update -r b_XYZ_descriptive file.F90
     [ We now update to the new branch so we can commit. ]
  4. Commit your code:
     cvs commit file.F90
  5. Tag your code and update to that tag (optional):
     cvs tag my-tag-name file.F90
     cvs update -r my-tag-name file.F90
     [ As non-branch tags are easy to remove and change, naming
       practices are not as strict here. The plus of tagging
       and then updating to that tag is that you can't commit
       to a sticky tag, so you have to explicitly update to
       a branch to figure it out. ]