Skip to content
Jim Edwards edited this page Jun 26, 2024 · 1 revision

Including git-fleximod in other repositories

The most transparent way to deliver git-fleximod to users of a repository is to install it using pip or conda, however many users want to distribute it along with the package it supports.

The development history of git-fleximod is not relevant to most uses of the tool, so the subtree history should be squashed to avoid polluting the client repository with unneeded history and tags.

The recommended workflow for including git-fleximod as a subtree is to pull a branch whose head is at the desired tag instead of the tag itself.

from your host repository:
git remote add fleximod https://github.com/ESMCI/git-fleximod.git
git fetch fleximod --no-tags
git subtree pull --squash --prefix .lib/git-fleximod fleximod HEAD

When you look at the subtree pull log message, the most recent hash in the change list should match the git-subtree-split line, e.g. d6423c6 in the output below.

Squashed 'git-fleximod/' changes from 5fc8709..d6423c6

d6423c6 Bugfix: timeout limit for subprocesses
7998f60 Update readme and help output
00b6fb2 Bugfix: add explicit schema version checking
0527869 Update readme
1ae8c84 Merge bugfix branch for stale subexternals into master.
b0c16d7 Bugfix: stale sub-externals after checkout.
30a4e44 Finish implementing system test for mixed-use externals
ac7ff96 Update mixed-use test repo.
bfda7b9 Bugfix: regexp for determining git tracking branches

git-subtree-dir: .lib/git-fleximod
git-subtree-split: d6423c68f0948329e048d4c317aa3070164225c2

If you see a different hash in the git-subtree-split line, then you probably pulled in an annotated tag. For example 81ccf92e8c4 doesn't match 0527869:

Squashed 'git-fleximod/' changes from 5fc8709..81ccf92

0527869 Update readme
1ae8c84 Merge bugfix branch for stale subexternals into master.
b0c16d7 Bugfix: stale sub-externals after checkout.
30a4e44 Finish implementing system test for mixed-use externals
ac7ff96 Update mixed-use test repo.
bfda7b9 Bugfix: regexp for determining git tracking branches

git-subtree-dir: git-fleximod
git-subtree-split: 81ccf92e8c4da272121fcc96902021be9e7a7b1f
Clone this wiki locally