This repo tracks the project repos as submodules. That gives one place to see everything, at the cost of the usual submodule sharp edges.
Nothing here duplicates control-template — a project repo bootstrapped from the
template already contains its own layout, standards, and docs. This page covers
only the hub-specific mechanics.
./tools/sync-all.shRun it after every git pull in this repo. A pull here moves the pointers;
only this script moves your working copies.
If a submodule shows a + in git submodule status, its checked-out commit
differs from the pointer recorded here. Common, usually harmless during local
work. Commit the work in the submodule, then update the pointer here.
-
Create the repo from
control-template(see its README) and push it. -
Register it here:
./tools/add-submodule.sh \ git@github.com:Hyperloop-UPV/<project>.git \ src/algorithms/<project> main -
Add a row to the project table in the root README.
-
Commit
.gitmodulesand the new path together — the pointer and the registration are one change.
Mount points are grouped by kind: src/algorithms/ for controllers,
src/models/ for system models, src/libraries/ for shared Simscape or
function libraries. add-submodule.sh rejects any target outside src/,
because MATLAB sources do not belong in the hub.
The order matters. In the submodule:
cd src/algorithms/<project>
git commit && git pushThen in the hub, point at the new commit:
cd -
git add src/algorithms/<project>
git commit -m "point <project> at <short-sha>"
git pushTwo pushes, in that order. If the hub pointer is pushed first, CI-less
teammates pull a pointer to a commit their clone cannot fetch, and
sync-all.sh fails with a confusing error.
git rm src/algorithms/<project>Then remove the row from the README table in the same commit. Do not delete the upstream repo while a pointer still references it.
| Prefix | Meaning | Action |
|---|---|---|
| (space) | Checked out, matches the pointer | Nothing |
- |
Not initialised | ./tools/sync-all.sh |
+ |
Different commit from the pointer | Intentional local work, or stale |
U |
Merge conflict on the pointer | Resolve in this repo, then git add the path |
Simulink .slx files are zip archives. They do not diff, they merge badly, and
they bloat history. Splitting by project keeps those files in small repos where
history stays navigable, and lets a project be cloned on its own. The cost is
the bookkeeping on this page, which is what the scripts are for.
./tools/check-repo.shFails if MATLAB sources have been committed to the hub, if submodules are uninitialised or diverged, or if doc index files are missing. Run it before pushing here. It is deliberately not wired into CI — the team has decided against CI on these repos for now, and there is no MATLAB licence in CI anyway.