Maintaining the CIME subtree in ACME

Why subtree for CIME?

Very early in ACME, we decided that we want developers to get a working version of the code with a single "git clone" command.  For that reason, we use subtree to maintain CIME within ACME because CIME must be present for building/running the model.  Submodule requires an additional command after the git clone.

Terms

"the fork" refers to ACME's fork of CIME:  https://github.com/ACME-Climate/cime (no longer used)

"the upstream repo" refers to ESMCI CIME:  https://github.com/ESMCI/CIME

"the subtree" refers to all the code under https://github.com/ACME-Climate/ACME/cime

Initial add of CIME2 to ACME:

This was done once.

ACME was freshly cloned (from Sept 3, 2015 head: https://github.com/ACME-Climate/ACME/commit/c2b9b202f95cba910b72a53acc4c747beac316a7 and a remote for the ACME CIME fork was added:

git remote add -f --tags acmecime git@github.com:ACME-Climate/cime.git
CIME was added with this command:
git subtree add --squash --prefix=cime/ acme-merge2.1

Subsequent commits did the following:

  • move model components to their cime locations
  • add cime build capability
  • remove the models directory
  • add ability to build component models with cime.

Summary of merges and splits involving CIME5

directioncommit on master and date merged. PR link.feature branch that was merged to masterhow feature branch was creatednotes
merge ESMCI to ACME

in ACME c50a810d9544251d50

 

https://github.com/ACME-Climate/ACME/pull/1169

in ACME: /rljacob/cime/cime5-upgrade

in ACME: First removed cime2 in 8ed674f84ce

Then did a subtree merge squash of 0eb331d in 7d7641505cc

That squash was merge-committed to the branch in 15abd5853

brought in CIME5.1.4

Did a bunch more commits on that branch to get everything working.

split ACME to ESMCI

git subtree split c50a810d95442^.. --onto=0eb331d371 --prefix=cime/ -b rljacob/split-cime51-5send ACME's CIME5.1 changes to ESMCI
merge ESMCI to ACMEin ACME rljacob/cime/uptocime5.2.0

brought in CIME5.2.0

215e459 is commit in ESMCI last brought to ACME, which is the 5.2.0 tag

split ACME to ESMCI


2 on ESMCI:

agsalin/cime52-with-acmesplit-03292017

acme commits merged to CIME 5.2


agsalin/merge-from-acme-03292017

Commits merged with ESMCI master

Starting from ACME master, commit f255704 by Az on March 28.


git subtree split 628a26d^.. --prefix=cime \
--onto=215e459 --ignore-joins -b agsalin/split-03292017

Send ACME's CIME5.2 changes to ESMCI

(Acme changes as of 2017-03-29 since last split)

Notes:

628a26d is first commit in ACME after last merge

Branch agsalin/split-03292017 not pushed (acme code sizeof cime repo?)

merge ESMCI back to ACME

On ACME:

agsalin/update-to-cime5.3


git checkout -b agsalin/update-to-cime5.3

git fetch esmcicime

git subtree pull --prefix=cime esmcicime master

Brought in CIME 5.3.0-alpha06

CIME master hash: 6156e0a

tag: cime5.3.0-alpha.06-toacme01

To facilitate merge, I first moved all ACME files to the new cime dir name, before subtree pull.

Brought in entire CIME commit history.

merge ESMCI to ACME

On ACME:

agsalin/update-to-cime5.3.1

started 5/2/2107


same as above

Brought in CIME 5.3.0-alpha.10

CIME master hash: 15297cd

tag: cime5.3.0-alpha.10-toacme01

merge more ESMCI changes to ACME, without doing ACME→ESMCI first.

split ACME to ESMCI

ACME commit: acme-split-06-01-2017

onto

ESMCI commit: cime5.3.0-alpha.10-toacme01


Change instructions to use tags
merge ESMCI to ACME

in ACME 2a095e62

11 Oct 2017

https://github.com/ACME-Climate/ACME/pull/1788

On ACME:

jgfouca/update_to_cime_5.3.0.34

same as in previous ESMCI→ACME mergesbrought in CIME 5.3.0.alpha34
split ACME to ESMCI


Make script
merge ESMCI to ACME


Make script


MERGES/SPLITS ARE NOW CONSIDERED ROUTINEWE WILL NO LONGER BE MAKING TABLE ENTRIES


Add of CIME5 to ACME:

The existing cime was removed with git rm and the above repeated with

git remote add esmcicime git@github.com:ESMCI/cime.git

Updating ACME's CIME from ESMCI:

ACME/cime/scripts/Tools/acme_cime_merge [<repo-to-use>]


Bringing ACME CIME changes back to ESMCI:

(The example code below is from the first time this was done)

NOTE:  if your work on a branch requires changing files in a subtree, be sure to commit those changes separately.  This will aid the future subtree split of those files back to the external.


ACME/cime/scripts/Tools/acme_cime_split [<repo-to-split>]