This repo contains the core simulation code for RangeShifter v3.0 and is not meant to be compiled or run on its own. It is used as a shared codebase for multiple interfaces.
If you are only interested in using RangeShifter, you can ignore this and head to the repo of one of the interfaces:
-
[WIP] RangeShifter GUI
In order to ensure that the same version of RangeShifter's core code is used by all three interfaces (RangeShiftR, RangeShifter-batch and the GUI), each interface repo keeps a copy of RScore as a git subtree.
In this section, we describe how to use the git subtrees to update the subfolder and copy this repo anew.
Modifying files inside the RScore subtree directly in the interface repositories can lead to merge conflicts or broken history, if you do not strictly follow the workflow presented here.
You must ensure that you always push changes on files located in the RScore directory to the git subtree repository RScore using git subtree push and must not push them to the RangeShiftR-pkg or RangeShifter_batch repository.
The most robust way to avoid merge conflicts and broken history is to modify files directly inside the RScore repository and then pull the changes into the interface repositories by using git subtree pull.
First, in a local clone of one of the interface repos, add a remote named RScore pointing to the RScore repo. This will be convenient as a shortcut for git subtree commands.
git remote add RScore https://github.com/RangeShifter/RScore.gitTo update the RScore subfolder with new changes made to the RScore repo, one can use the git subtree pull command:
git subtree pull --prefix <path_to_RScore_subfolder> RScore <branch>Note the path must match the location of the RScore subfolder, and the branch must match the one the subtree was originally added from (by default, this should be main).
e.g. for RangeShifter-batch, use:
git subtree pull --prefix src/RScore RScore mainwhile for RangeShiftR, use:
git subtree pull --prefix RangeShiftR/src/RScore RScore mainIf conflicts occur, the RScore repository should be treated as the source of truth:
git checkout --theirs <path_to_RScore_subfolder>
git add <path_to_RScore_subfolder>
git commit
If changes were made inside the subtree directory (not recommended, but sometimes unavoidable), they must be pushed back to this repository before pushing to the interface repository:
git subtree push --prefix <path_to_RScore_subfolder> RScore <branch>e.g., from RangeShifter-batch's main to RScore's main:
git subtree push --prefix src/RScore RScore mainAfterwards, update other interface repositories using git subtree pull.
There is unfortunately to do so. To track a different branch of RScore, one must delete the RScore subfolder (via git) and import the subtree again:
git rm src/RScore -r
git commit -m "switching subtree branch"
git subtree add --prefix src/RScore RScore <the new branch>See CONTRIBUTING.
