From e65053feeb2e2b063257ec5ed5a720d45a25942e Mon Sep 17 00:00:00 2001 From: cproudlock Date: Sun, 30 Aug 2026 09:06:56 -0400 Subject: [PATCH] One bundle per branch, named after it The export wrote a single shopdb-flask-pub.bundle whatever it published. That was fine while only main was ever published, and became a trap the moment it was not: exporting a site branch silently overwrote the bundle holding main's work, and the work PC's documented "git fetch main" then failed because that ref was no longer in the file. It had already happened here - two wj exports overwrote a main bundle from the same morning. The failure is at least loud on the work PC rather than pushing the wrong branch, but the main bundle has to be regenerated. Now shopdb-flask-pub-.bundle. Two branches cannot share one filename. Scope: product (cherry picked from commit 1311dea1132be23da2cca9b3d04191d16e6f461b) --- tools/export-github.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/export-github.sh b/tools/export-github.sh index cbcb788f..907408e8 100755 --- a/tools/export-github.sh +++ b/tools/export-github.sh @@ -244,10 +244,19 @@ fi git log --oneline -3 # --- 5. bundle for transfer (full bundle: stateless, fetch takes only new) --- -# Carries the branch that was published, not a hardcoded main. -git bundle create "$OUT/shopdb-flask-pub.bundle" HEAD "$BRANCH" --tags -git bundle verify "$OUT/shopdb-flask-pub.bundle" >/dev/null -echo "bundle: $OUT/shopdb-flask-pub.bundle" +# +# ONE BUNDLE PER BRANCH, named after it. +# +# This wrote a single shopdb-flask-pub.bundle whatever it published, which was +# fine while only main was ever published and became a trap the moment it was +# not: exporting a site branch silently overwrote the bundle holding main's +# work, and the work PC's documented `git fetch main` then failed +# because that ref was no longer in the file. Two branches cannot share one +# filename. +BUNDLE="$OUT/shopdb-flask-pub-$BRANCH.bundle" +git bundle create "$BUNDLE" HEAD "$BRANCH" --tags +git bundle verify "$BUNDLE" >/dev/null +echo "bundle: $BUNDLE" # --- 6. optional per-instance dists (both bases: /ops = dev, /shopdb = prod) --- # Two instances run on the box; each needs its own base-path build. Always @@ -266,7 +275,7 @@ cat <\shopdb-flask-pub.bundle $BRANCH + git fetch \shopdb-flask-pub-$BRANCH.bundle $BRANCH git merge --ff-only FETCH_HEAD git push origin $BRANCH EOF