chore(config): align branch post-checkout with main's do-nothing version

Reconciles the branch's earlier export --stage hook (d2cbdc243) with main's
superseding do-nothing fix (b24a3596b) so the two merge cleanly instead of
conflicting on this file. (The hook fix is already live on main; this just keeps
the branch copy identical.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-16 12:51:33 +02:00
co-authored by Claude Opus 4.8
parent 43aadc4491
commit 2d85f8ca3c
+11 -14
View File
@@ -6,19 +6,16 @@
# in sync with the changelog. File-level checkouts ($3 == 0) are skipped.
# Args: <prev-HEAD> <new-HEAD> <branch-flag>.
#
# prev-HEAD == new-HEAD means the working-tree content did not change — a branch
# *creation* (`git checkout -b`) or a no-op checkout. pql.db is already correct
# for this content, so a `plan rebuild` here would only DROP uncommitted ticket
# mutations that have not reached the changelog yet (e.g. a just-activated
# in_progress status set right before the branch was cut). Instead, flush + stage
# them — the same changelog capture the pre-commit hook does — so the activation
# is durable across the checkout. A real branch *switch* (prev != new) loads a
# different changelog, so rebuild pql.db to match the branch we moved to.
if [ "${3:-0}" = "1" ] && command -v pql >/dev/null 2>&1; then
if [ "$1" = "$2" ]; then
pql plan export --stage >/dev/null 2>&1 || true
else
pql plan rebuild >/dev/null 2>&1 || true
fi
# Only a real branch *switch* (prev-HEAD != new-HEAD) loads a different changelog
# and needs a rebuild. On a branch *creation* (`git checkout -b`) or no-op checkout
# (prev == new) the working-tree content is unchanged, so pql.db already holds the
# committed state AND any uncommitted ticket mutation set just before the branch was
# cut (e.g. a just-activated in_progress status) — so do NOTHING. A rebuild there
# would drop that mutation; the next commit's pre-commit hook flushes it normally.
# Doing nothing (rather than an eager `export --stage`) also avoids staging changelog
# rows mid-checkout — those could otherwise leak onto the wrong branch when a later
# switch rebuilds by replaying the working-tree changelog.
if [ "${3:-0}" = "1" ] && [ "$1" != "$2" ] && command -v pql >/dev/null 2>&1; then
pql plan rebuild >/dev/null 2>&1 || true
pql decisions sync >/dev/null 2>&1 || true
fi