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:
@@ -35,9 +35,9 @@ if ! bd sync --flush-only >/dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Stage both possible JSONL files (backward compatibility)
|
||||
# Stage all tracked JSONL files (beads.jsonl, issues.jsonl for backward compat, deletions.jsonl for deletion propagation)
|
||||
# git add is harmless if file doesn't exist
|
||||
for f in .beads/beads.jsonl .beads/issues.jsonl; do
|
||||
for f in .beads/beads.jsonl .beads/issues.jsonl .beads/deletions.jsonl; do
|
||||
[ -f "$f" ] && git add "$f" 2>/dev/null || true
|
||||
done
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user