CVS Best Practices: Difference between revisions
Cut-and-paste from doc in SI Team CVS |
Wikify'd |
||
Line 1: | Line 1: | ||
==Branch Name Style== | |||
We recommend using | |||
b_XYZ_descriptive | |||
where <code>XYZ</code> are your initials and <code>descriptive</code> is a descriptive name for your branch. | |||
==Branching files== | |||
''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: | To branch your modified file on a new branch, assume you've made modifications to file.F90 and want to save these to a new branch of the model. To do so: | ||
===Tag the ROOT of your new branch=== | |||
We recommend that prior to branching your code, you tag where you branched from by running: | |||
cvs tag b_XYZ_descriptive_ROOT file.F90 | |||
This can aid in allowing for easy tracing of your modifications to know where you started from. | |||
===Create a branch relative to ROOT tag=== | |||
This says relative to that ROOT, we create a branch of name <code>b_XYZ_descriptive</code>: | |||
cvs tag -r b_XYZ_descriptive_ROOT -b b_XYZ_descriptive file.F90 | |||
===Update your file to your new branch=== | |||
We now update to the new branch so we can commit. | |||
cvs update -r b_XYZ_descriptive file.F90 | |||
===Commit your code=== | |||
Finally commit your code with: | |||
cvs commit file.F90 | |||
This will open up your favorite editor to add an explanatory message. We recommend this message start with your initials (so when doing <code>cvs log</code> we know who added the message: | |||
XYZ: Added new functionality to file.F90 | |||
CVS: ---------------------------------------------------------------------- | |||
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically | |||
CVS: | |||
CVS: Committing in . | |||
CVS: | |||
CVS: Modified Files: | |||
CVS: Tag: b_XYZ_descriptive | |||
CVS: file.F90 | |||
CVS: ---------------------------------------------------------------------- | |||
===Tag your code and update to that tag (optional)=== | |||
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. | |||
cvs tag my-tag-name file.F90 | |||
cvs update -r my-tag-name file.F90 |