Fix bd-my64: Pre-push hook blocks instead of exports

The original pre-push hook tried to export DB → JSONL during the push,
then run 'git add', but this doesn't work because:

1. The commit is already created when pre-push runs
2. git add in pre-push stages files for a FUTURE commit
3. The current push sends the old commit with stale JSONL
4. Result: dirty git status after push

Fix:
- Pre-push now CHECKS for uncommitted JSONL changes
- If found, it FAILS the push with clear instructions
- User must commit JSONL before pushing
- This prevents stale JSONL from reaching remote

The pre-commit hook already properly flushes changes, so this
catch-all prevents changes made BETWEEN commit and push.

Amp-Thread-ID: https://ampcode.com/threads/T-39a89553-c301-4d4f-b39f-6df9c403d22b
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-11-06 18:57:34 -08:00
parent 2cb97e4d22
commit 3ba245e6c0
5 changed files with 76 additions and 40 deletions

View File

@@ -59,7 +59,7 @@ echo "✓ Git hooks installed successfully"
echo ""
echo "Hooks installed:"
echo " pre-commit - Flushes pending bd changes to JSONL before commit"
echo " pre-push - Blocks push if JSONL has uncommitted changes (bd-my64)"
echo " post-merge - Imports updated JSONL after git pull/merge"
echo " pre-push - Exports database to JSONL before push (prevents stale JSONL)"
echo ""
echo "To uninstall, remove the hooks from .git/hooks/"