-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build frontend: Easily switch to branch/commit for component models #30
Comments
I have initially suggested this in the frontend PR, but what if we change the signature to something like this: ./build_tsmp2.sh --eCLM <optional-arg> --PDAF <optional-arg> where |
Thank you for the feedback! I think implementing a commit hash/branch could be done very straight forward by modifying a few lines in the @kvrigor : In general I like the idea of minimizing the number of options. However, the mentioned option (2) + (3) do not exclude each other. Thus, it can have either one of the options or both options. That make the implementation not so straight forward (at least I do not see an easy way) and might get more complicated when it points out that we need more options. |
Mixed option 2 + 3 is surely possible but I doubt that it appears in practice. When a user specifies a path (option 3), my expectation is the user wants finer control of the source repo and thus can manage the repo by themselves. This mindset is very different from a user who wishes to specify a commit/branch (option 2); user still prefers the convenience of
I think these 3 options already cover most of basic use cases; anything more complicated than that I'd suggest to use the |
Thanks for the comments! As I said, from my experiences, this change would benefit users, but I do want to keep the workload minimal. From my side, two thoughts in this direction
|
Here's a sample implementation which covers all 3 cases without introducing excess flags. This doesn't look complicated IMO... if [[ -z "$optional_arg" ]]; then
# Empty optional_arg
echo "No optional arg supplied: using git submodule..."
else
# Non-empty optional_arg
if [[ -d "${$optional_arg}" ]]; then
model_src=${optional_arg}
echo "Compiling ${model} from ${model_src} ..."
else
# simply assume a git commit hash or branch
commit_id=${$optional_arg}
cd ${model_submodule_path}
if git checkout ${commit_id}; then
echo "Success!"
else
echo "Invalid arg supplied to --${model}: ${optional_arg}"
exit 1
fi
fi
fi |
Small update: It has become a habit for me to introduce commits in a submodule by changing the submodule-commit in a branch of TSMP2. I think forcing developers to do introduce TSMP2-branches could be an alternative path - the downside is some extra git-commands, a larger number of branches in TSMP2 and corresponding branches needed in both the submodule and TSMP2 for testing. |
From the first few user experiences with the nice new TSMP2-frontend, it was found that it could be nice to include a simple way of switching the branch/commit of a component model or PDAF.
Oftentimes users do not work on the exact submodule commits, but rather they are developing one or more of the component models.
Would it be relatively easy to include something like
--PDAF_HEAD
that one could provide with a branch name or commit hash and then this version would be checked out instead of the default submodule version?The text was updated successfully, but these errors were encountered: