I have a simulation model that is in the form of a Julia package, i.e. I can do using mypkg
and call the function run()
. This works fine, but I have several scientific projects that use this model and each project is slightly different in terms of the dynamics or algorithm changes.
My master branch that is the most updated model naturally. I have dev
’ed this in my local dev machine. But lets say I am working on a project which branched off the master about a month ago. My current workflow is to manually git checkout commitid
(thus going to the old cold) then call using mypkg
which also then triggers recompilation and so on.
I am wondering if this can be automated slightly. Is it possible to do something like using mypkg#commitid
so that it pulls in that specific commit id (or branch)? This way I won’t have to keep checking out different commits and switching from master back and forth.
Furthermore, this would really help with scientific reproducibility. (I realize that anyone can actually do add mypkg#commitid
but that dosn’t help me). For example, I can just tell someone to add my package add mypkg
, and pass them a “script” file that says using mypkg#commitid
so that the end user dosn’t have to worry about manually add
’ing the correct branch.