Files
settled-reach/.config/hooks/post-merge
T
jpmschweitzerandClaude Opus 5 dd0f9804b5 chore(meta): install pql replication hooks and cover the format marker
This repo had no .pql/hooks/ at all — the four replication hooks were
never installed, because pql's installer used to ignore a redirected
core.hooksPath. It works with .config/hooks now, so init prepends a
two-line shim to each hook that sources the pql half. Existing hook
bodies are untouched; the shim goes above them.

What this buys: post-merge now runs `pql plan upgrade`, so a pull that
brings in a newer changelog format migrates it forward automatically
instead of replaying under superseded rules.

.gitattributes gains a rule for changelog files at the root of
.pql/changelog/. The existing `**/*.sql` pattern requires a directory
component and so did not match the new 0000-format.sql marker, which
would have made it a merge conflict rather than a union merge.

Note for a follow-up: the hand-folded pql block in .config/hooks/post-merge
(lines ~10-12) is now redundant with the shim, so plan import and
decisions sync each run twice per pull. Both are idempotent, so this is
waste rather than breakage — but that block and its stale "installer is
dead" comment can be dropped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 11:35:35 +02:00

14 lines
663 B
Bash
Executable File

#!/usr/bin/env bash
# pql: source .pql/hooks/post-merge
_pql_hook="$(git rev-parse --show-toplevel)/.pql/hooks/post-merge"; [ -f "$_pql_hook" ] && . "$_pql_hook"
# Post-merge hook (also fires after `git pull`). Folds in pql's planning logic;
# pql's own .pql/hooks installer is dead under core.hooksPath=.config/hooks.
#
# Replays any changelog files the merge brought in (idempotent, LWW — D-16) and
# re-syncs decisions from governance/*.md so the markdown-sourced half stays in
# step. Both are no-ops when nothing changed.
if command -v pql >/dev/null 2>&1; then
pql plan import >/dev/null 2>&1 || true
pql decisions sync >/dev/null 2>&1 || true
fi