Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
noresm:svnbestpractice [2014-01-02 08:58:49] alfg [Tricky use cases] |
noresm:svnbestpractice [2022-05-31 09:29:32] (current) |
||
---|---|---|---|
Line 4: | Line 4: | ||
Follow this link to find the tutorial: [[NORESM: | Follow this link to find the tutorial: [[NORESM: | ||
+ | |||
+ | **Note: As of November 13th 2015, NorESM uses git as version control system. The rules and guidelines for merging/ | ||
===== Branches ===== | ===== Branches ===== | ||
Line 18: | Line 20: | ||
Create a branch with (http:// | Create a branch with (http:// | ||
< | < | ||
- | $ svn copy http:// | + | |
| | ||
-m " | -m " | ||
+ | </ | ||
+ | or specifically for the NorESM repository with | ||
+ | < | ||
+ | svn copy https:// | ||
+ | | ||
+ | -m " | ||
</ | </ | ||
Line 26: | Line 34: | ||
< | < | ||
svn checkout $BRANCHURL nameOfBranchOnMyPC | svn checkout $BRANCHURL nameOfBranchOnMyPC | ||
+ | </ | ||
+ | |||
+ | |||
+ | In git: First create your new branch locally and then make the remote aware of the new branch like so: | ||
+ | < | ||
+ | git checkout -b my_branch_name | ||
+ | git push -u origin my_branch_name | ||
+ | </ | ||
+ | |||
+ | ..and make sure your .gitconfig-file is configured for doing a merge (for example): | ||
+ | < | ||
+ | [merge] | ||
+ | tool = vimdiff | ||
+ | [diff] | ||
+ | tool = vimdiff | ||
</ | </ | ||
Line 40: | Line 63: | ||
The NorESM branches have the following **naming convension : {PurposeOfLife}_{ParentTagName}**. This means that a branch name should state **why** it is created and **where** it is created from. | The NorESM branches have the following **naming convension : {PurposeOfLife}_{ParentTagName}**. This means that a branch name should state **why** it is created and **where** it is created from. | ||
- | PurposeOfLife is a text string (allowed characters are a-z, A-Z, 0-9 and " | + | PurposeOfLife is a text string (allowed characters are a-z, A-Z, 0-9 and " |
* a //feature// branch is a temporary branch created to work on a complex change without interfering with the stability of /trunk (or another parent branch). Feature branches are always reintegrated. See also http:// | * a //feature// branch is a temporary branch created to work on a complex change without interfering with the stability of /trunk (or another parent branch). Feature branches are always reintegrated. See also http:// | ||
* a //release// branch is created if a version with frozen functionality is desired. The development on the release branch itself is limited to bug fixes, addition of forcing scenarios and other minor changes. Releases branches are not reintegrated. | * a //release// branch is created if a version with frozen functionality is desired. The development on the release branch itself is limited to bug fixes, addition of forcing scenarios and other minor changes. Releases branches are not reintegrated. | ||
- | * a //private// branch can be created if a project requires a strongly tailored version of the model, that typically is maintained by only one person. Commits to a private branch should be agreed on with the branch creator. Private branches are not reintegrated. | + | |
+ | | ||
ParentTagName is the name of an existing noresm tag. | ParentTagName is the name of an existing noresm tag. | ||
Line 52: | Line 76: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | * '' | ||
- | Note that in this scheme a new branch is never branched off directly from trunk or another branch. A tag MUST be created before creating a branch (see section on tags below). | + | Note that in this scheme a new branch is never branched off directly from trunk or another branch. |
+ | |||
+ | Note that purposeOfLife of release-branches contains version numbers. " | ||
==== A note on branch / tag naming ==== | ==== A note on branch / tag naming ==== | ||
Line 91: | Line 118: | ||
If your code does not pass the tests, you can **not** merge your code back to the trunk | If your code does not pass the tests, you can **not** merge your code back to the trunk | ||
- | Note that in svn, **you can only merge ONE time from your branch to the trunk**, or you risk making a mess of the system! (See http:// | + | Note that in svn, **you can only merge ONE time from your branch to the trunk**, or you risk making a mess of the system! (See http:// |
The merge command (from trunk) will be something like (http:// | The merge command (from trunk) will be something like (http:// | ||
< | < | ||
svn merge --reintegrate $BRANCHURL | svn merge --reintegrate $BRANCHURL | ||
+ | </ | ||
+ | |||
+ | Using git, just use | ||
+ | < | ||
+ | git merge branchNameIWantToMergeWith | ||
</ | </ | ||
===== Tags ===== | ===== Tags ===== | ||
Line 109: | Line 141: | ||
Create the tag with a command like (http:// | Create the tag with a command like (http:// | ||
< | < | ||
- | svn copy http:// | + | |
| | ||
-m " | -m " | ||
+ | </ | ||
+ | or specifically for the NorESM repository with | ||
+ | < | ||
+ | svn copy https:// | ||
+ | | ||
+ | -m " | ||
</ | </ | ||
Line 117: | Line 155: | ||
You should create a tag in the following cases: | You should create a tag in the following cases: | ||
- | * When you want to create a branch! **Always tag the model first and then create the branch from the tag**. | + | * When you want to create a branch! **Always tag the model first and then create the branch from the tag**. |
* A " | * A " | ||
* A version which has been used for some specific paper (maybe you want to do more runs after referee comments) | * A version which has been used for some specific paper (maybe you want to do more runs after referee comments) | ||
+ | |||
+ | ==== What tags exist? ==== | ||
+ | |||
+ | All tags are in https:// | ||
==== How should I name the tag? ==== | ==== How should I name the tag? ==== | ||
Line 146: | Line 188: | ||
Note how this is consistent with the branch naming scheme. **You actually need to create a tag in order to give your branch a proper name!** | Note how this is consistent with the branch naming scheme. **You actually need to create a tag in order to give your branch a proper name!** | ||
+ | |||
+ | ==== Tagging noresm0 and noresm1 branches? ==== | ||
+ | |||
+ | NorESM0 and NorESM1 had a quite random naming convension for branches where branch names involved " | ||
+ | |||
+ | Therefore, even though it is confusing it is proposed here to use " | ||
+ | |||
+ | **purposeOfLife of NorESM1 branches is therefore whatever follows after " | ||
===== Tricky use cases ===== | ===== Tricky use cases ===== | ||
Line 190: | Line 240: | ||
==== What should be stated in the commit message? ==== | ==== What should be stated in the commit message? ==== | ||
+ | |||
+ | **Always state the JIRA issue associated with the work**! This makes the code changes pop up in JIRA!: For example "svn commit -m " | ||
The commit message should include a concise description of the committed changes. | The commit message should include a concise description of the committed changes. | ||
Line 215: | Line 267: | ||
Revision 198 | Revision 198 | ||
- | | + | |
Revision 193 | Revision 193 | ||
- | | + | |
Revision 190 | Revision 190 | ||
+ | |||
+ | | ||
</ | </ | ||
Line 240: | Line 294: | ||
changes made in r200 to branch featureMicomDevelopment... | changes made in r200 to branch featureMicomDevelopment... | ||
</ | </ | ||
- |