File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/zsh
2+
3+ # Historical: Initialize the pyret monorepo by pulling each subrepo into its
4+ # own branch, moving its files into a subdirectory, tagging the import, then
5+ # merging all branches into main.
6+
7+ typeset -A repos=(
8+ [" embed" ]=" git@github.com:jpolitz/pyret-embed.git"
9+ [" vscode" ]=" git@github.com:jpolitz/pyret-parley-vscode.git"
10+ [" npm" ]=" git@github.com:brownplt/pyret-npm.git"
11+ [" pyret.org" ]=" git@github.com:brownplt/pyret.org.git"
12+ [" docs" ]=" git@github.com:brownplt/pyret-docs.git"
13+ [" codemirror-mode" ]=" git@github.com:brownplt/pyret-codemirror-mode.git"
14+ [" code.pyret.org" ]=" git@github.com:brownplt/code.pyret.org.git"
15+ [" lang" ]=" git@github.com:brownplt/pyret-lang.git"
16+ )
17+
18+ pull_subrepo () {
19+ local branch=" $1 "
20+ local repo=" $2 "
21+ branch=" $1 "
22+ repo=" $2 "
23+
24+ git branch " $branch "
25+ git checkout " $branch "
26+ git pull --allow-unrelated-histories --no-ff " $repo "
27+
28+ mkdir " $branch "
29+ git mv $( git ls-tree --name-only " $branch " ) " $branch "
30+ git commit -m " move $branch files into $branch "
31+ git checkout main
32+ }
33+
34+
35+ git init
36+ git commit --allow-empty -m " Initial commit"
37+
38+ for branch in " ${(@ k)repos} " ; do
39+ echo " $branch " " ${repos[$branch]} "
40+ pull_subrepo " $branch " " ${repos[$branch]} "
41+ git tag -a " repo-$branch " " $branch " -m " Moving ${repos[$branch]} into monorepo as $branch /"
42+ done
43+
44+ for branch in " ${(@ k)repos} " ; do
45+ git merge " $branch "
46+ done
You can’t perform that action at this time.
0 commit comments