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 <bundle> 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-<branch>.bundle. Two branches cannot share one filename.

Scope: product
(cherry picked from commit 1311dea113)
This commit is contained in:
cproudlock
2026-08-30 09:06:56 -04:00
parent 442db6a664
commit e65053feeb

View File

@@ -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 <bundle> 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 <<EOF
On the work PC (in the shopdb-flask-pub clone):
git checkout $BRANCH
git fetch <path-to>\shopdb-flask-pub.bundle $BRANCH
git fetch <path-to>\shopdb-flask-pub-$BRANCH.bundle $BRANCH
git merge --ff-only FETCH_HEAD
git push origin $BRANCH
EOF