From 02654a51c750758bea456ce3c67a89f2f970e941 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 24 Oct 2021 07:19:38 -0700 Subject: [PATCH] move GLFW into sub-repository, use git subtree to sync (#42) * README: move GLFW into sub-repository, describe git subtree usage Signed-off-by: Stephen Gutekanst * dev: add subrepo sync scripts Signed-off-by: Stephen Gutekanst --- README.md | 25 +++++++++++++++++++++++++ dev/pull-subrepos.sh | 6 ++++++ dev/push-subrepos.sh | 6 ++++++ dev/update-subrepos.sh | 6 ++++++ 4 files changed, 43 insertions(+) create mode 100755 dev/pull-subrepos.sh create mode 100755 dev/push-subrepos.sh create mode 100755 dev/update-subrepos.sh diff --git a/README.md b/README.md index bf7cb154..a36b591e 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,28 @@ Mach is still incredibly early stages, so far we have support for building from * ✔️ Should work, not tested via CI yet. * 🏃 Planned or in progress. * ⚠️ Implemented, but has known issues (e.g. bugs in Zig.) + +## Libraries for all + +Whether you're interested in using all of Mach, or just some parts of it, you get to choose. +Our libraries all aim to have the same zero-fuss installation, cross compilation, and platform +support: + +* [mach-glfw](https://github.com/hexops/mach-glfw): Ziggified GLFW bindings with 100% API coverage + +## About sub-repositories + +In this repository, we maintain Mach as a monorepo. We pull in all commits from our library sub-repositories listed above using [`git subtree`](https://www.atlassian.com/git/tutorials/git-subtree): + +``` +git subtree pull --prefix glfw https://github.com/hexops/mach-glfw main +``` + +This pulls in all commits from our sub-repositories, and effectively leads to a full history of all Mach development across all core repositories. + +Pull requests can be made to any repository (we synchronize both ways via `git subtree pull` and `git subtree push`.) + +There are only two requirements: + +1. Pull requests in sub-repositories must have a commit message prefix, e.g. `glfw: ` to keep our monorepo history nicer - we generally squash merge pull requests so this is not an issue. +2. Pull requests to this repository may not change multiple sub-repositories in the same commit (e.g. a commit to `glfw/` should not also include changes to `webgpu/`, to avoid confusion.) diff --git a/dev/pull-subrepos.sh b/dev/pull-subrepos.sh new file mode 100755 index 00000000..84ba4c98 --- /dev/null +++ b/dev/pull-subrepos.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -exuo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")"/.. + +./dev/update-subrepos.sh +git subtree pull --prefix glfw mach-glfw main diff --git a/dev/push-subrepos.sh b/dev/push-subrepos.sh new file mode 100755 index 00000000..c3be07e2 --- /dev/null +++ b/dev/push-subrepos.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -exuo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")"/.. + +./dev/update-subrepos.sh +git subtree push --prefix glfw mach-glfw main diff --git a/dev/update-subrepos.sh b/dev/update-subrepos.sh new file mode 100755 index 00000000..f79d7473 --- /dev/null +++ b/dev/update-subrepos.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -exuo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")"/.. + +git remote add -f mach-glfw git@github.com:hexops/mach-glfw || true +git fetch mach-glfw