commit ebc99b00da6864353588a19daf65f85da305060d
parent 3f5ff3b6b68fd955e45e21d3c51a4a303fe8e8e0
Author: Henry Unite <unitehenry@gmail.com>
Date: Sat, 28 Nov 2026 19:46:51 +0000
feat(stagit): publish cloneable bare repositories
Copy each mirror into build/git/<name>.git and run update-server-info so repositories can be cloned over dumb HTTP.
Diffstat:
2 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/README.md b/README.md
@@ -23,13 +23,12 @@ be generated first. Projects without a GitHub link are skipped. The pages are
written to `build/git`. Repositories are mirrored under `.cache/stagit/repos`,
so later runs only fetch new commits.
-Each repository directory also includes a `repo.bundle` containing all branches
-and tags. Static hosting cannot clone directly from a bundle URL, so download
-the bundle first:
+Each repository is also published as a bare repository at
+`build/git/<name>.git`, prepared for dumb HTTP with `git update-server-info`.
+Clone it directly from the site:
```bash
-curl -O https://unitehenry.com/git/openpod/repo.bundle
-git clone repo.bundle openpod
+git clone https://unitehenry.com/git/openpod.git
```
Generated pages are styled with `static/git/style.css` and deployed by the
diff --git a/scripts/stagit b/scripts/stagit
@@ -135,7 +135,7 @@ while IFS=$'\t' read -r name description owner url; do
printf '%s\n' "$description" >"$repo_dir/description"
printf '%s\n' "$owner" >"$repo_dir/owner"
- printf '%s\n' "$url" >"$repo_dir/url"
+ printf '%s\n' "$BASE_URL/$name.git" >"$repo_dir/url"
repo_dirs+=("$repo_dir")
done <<<"$project_rows"
@@ -159,17 +159,14 @@ for repo_dir in "${repo_dirs[@]}"; do
cd "$OUT_DIR/$name"
"$STAGIT_BIN" -u "$BASE_URL/$name/" "$repo_dir"
- # Bundle all branches and tags so the repository can be downloaded.
- git --git-dir="$repo_dir" bundle create -q repo.bundle HEAD --branches --tags
-
- # Replace stagit's clone row with bundle download/clone instructions.
- clone_row="<tr class=\"url\"><td></td><td>Download <a href=\"$BASE_URL/$name/repo.bundle\">repo.bundle</a>, then run <code>git clone repo.bundle $name</code></td></tr>"
- find . -type f -name '*.html' -exec sed -i -E "s#<tr class=\"url\">.*</tr>#$clone_row#" {} +
-
# Assets are copied rather than symlinked so the build artifact works on
# hosts that do not preserve symlinks.
cp "$ASSET_DIR/style.css" "$ASSET_DIR/logo.png" "$ASSET_DIR/favicon.png" .
)
+
+ rm -rf "$OUT_DIR/$name.git"
+ cp -a "$repo_dir" "$OUT_DIR/$name.git"
+ git --git-dir="$OUT_DIR/$name.git" update-server-info
done
printf 'Generating index...\n'