From dd0f9804b5337a72f736a29fa661711ffe5d6d3b Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sat, 8 Aug 2026 11:35:35 +0200 Subject: [PATCH] chore(meta): install pql replication hooks and cover the format marker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .config/hooks/post-checkout | 2 ++ .config/hooks/post-merge | 2 ++ .config/hooks/post-rewrite | 2 ++ .config/hooks/pre-commit | 2 ++ .gitattributes | 1 + .gitignore | 2 ++ 6 files changed, 11 insertions(+) diff --git a/.config/hooks/post-checkout b/.config/hooks/post-checkout index 660157cd2..5670de725 100755 --- a/.config/hooks/post-checkout +++ b/.config/hooks/post-checkout @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# pql: source .pql/hooks/post-checkout +_pql_hook="$(git rev-parse --show-toplevel)/.pql/hooks/post-checkout"; [ -f "$_pql_hook" ] && . "$_pql_hook" # Post-checkout hook. Folds in pql's planning logic (its .pql/hooks installer is # dead under core.hooksPath=.config/hooks). # diff --git a/.config/hooks/post-merge b/.config/hooks/post-merge index f2602044f..51ba2301b 100755 --- a/.config/hooks/post-merge +++ b/.config/hooks/post-merge @@ -1,4 +1,6 @@ #!/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. # diff --git a/.config/hooks/post-rewrite b/.config/hooks/post-rewrite index d39a7780e..c17ab89cb 100755 --- a/.config/hooks/post-rewrite +++ b/.config/hooks/post-rewrite @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# pql: source .pql/hooks/post-rewrite +_pql_hook="$(git rev-parse --show-toplevel)/.pql/hooks/post-rewrite"; [ -f "$_pql_hook" ] && . "$_pql_hook" # Post-rewrite hook (fires after `git rebase` / `git commit --amend`). Folds in # pql's planning logic; its .pql/hooks installer is dead under # core.hooksPath=.config/hooks. diff --git a/.config/hooks/pre-commit b/.config/hooks/pre-commit index c5564d17a..199ffc318 100755 --- a/.config/hooks/pre-commit +++ b/.config/hooks/pre-commit @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# pql: source .pql/hooks/pre-commit +_pql_hook="$(git rev-parse --show-toplevel)/.pql/hooks/pre-commit"; [ -f "$_pql_hook" ] && . "$_pql_hook" # Pre-commit hook dispatcher. Runs modular checks from tooling/. # Installed via: git config core.hooksPath .config/hooks set -euo pipefail diff --git a/.gitattributes b/.gitattributes index e2f87f6dc..bb4c85a7a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ .pql/changelog/**/*.sql merge=union +.pql/changelog/*.sql merge=union diff --git a/.gitignore b/.gitignore index 8a12ad5e0..880da2ce0 100644 --- a/.gitignore +++ b/.gitignore @@ -126,3 +126,5 @@ client/settings.db-shm client/settings.db-wal .claude/settings.local.json +.pql/* +!.pql/changelog/