fix: git hooks now stage deletions.jsonl for cross-clone propagation

The pre-commit and pre-push hooks were only staging beads.jsonl and
issues.jsonl, but not deletions.jsonl. This caused deletions.jsonl
to remain untracked after bd cleanup or bd delete operations.

Updated all hook locations:
- cmd/bd/templates/hooks/pre-commit
- cmd/bd/templates/hooks/pre-push
- examples/git-hooks/pre-commit
- examples/git-hooks/pre-push
- .beads-hooks/pre-commit
- .beads-hooks/pre-push

Users with existing hooks should run: bd hooks install

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-11-26 20:29:47 -08:00
parent 5f5b559433
commit 6a024fb4d9
7 changed files with 13 additions and 12 deletions

View File

@@ -31,9 +31,9 @@ if command -v bd >/dev/null 2>&1; then
bd sync --flush-only >/dev/null 2>&1 || true
fi
# Collect all tracked or existing JSONL files (supports both old and new names)
# Collect all tracked or existing JSONL files (beads.jsonl, issues.jsonl for backward compat, deletions.jsonl for deletion propagation)
FILES=""
for f in .beads/beads.jsonl .beads/issues.jsonl; do
for f in .beads/beads.jsonl .beads/issues.jsonl .beads/deletions.jsonl; do
# Include file if it exists in working tree OR is tracked by git (even if deleted)
if git ls-files --error-unmatch "$f" >/dev/null 2>&1 || [ -f "$f" ]; then
FILES="$FILES $f"