-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsubtree_update.sh
executable file
·34 lines (30 loc) · 1.32 KB
/
subtree_update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
echo "Removing previous submodules"
git rm -rf cmdstan/stan/lib/stan_math/stan/math/torsten cmdstan/stan/lib/stan_math cmdstan/stan cmdstan stanc3 && git commit -am "rm previous container"
rm -rf cmdstan stanc3
if [ $# -eq 0 ]
then
cmdstan_branch="torsten-develop"
stan_branch="torsten-develop"
math_branch="torsten-develop"
torsten_math_branch="develop"
else
cmdstan_branch=$1
stan_branch=$2
math_branch=$3
torsten_math_branch=$4
fi
echo "Adding cmdstan ${cmdstan_branch} branch"
git subtree add --prefix=cmdstan --squash cmdstan ${cmdstan_branch}
git rm -rf cmdstan/stan && git commit -am "rm stan"
echo "Adding stan ${stan_branch} branch"
git subtree add --prefix=cmdstan/stan --squash stan ${stan_branch}
git rm -rf cmdstan/stan/lib/stan_math && git commit -am "rm math"
echo "Adding math ${math_branch} branch"
git subtree add --prefix=cmdstan/stan/lib/stan_math --squash math ${math_branch}
git rm -rf cmdstan/stan/lib/stan_math/stan/math/torsten && git commit -am "rm torsten_math"
echo "Adding torsten_math ${torsten_math_branch} branch"
git subtree add --prefix=cmdstan/stan/lib/stan_math/stan/math/torsten --squash torsten_math ${torsten_math_branch}
# include stanc3 for debugging
echo "Adding stanc3 torsten-develop branch"
git subtree add --prefix=stanc3 --squash stanc3 torsten-develop