Commit Graph

5 Commits

Author SHA1 Message Date
cbarber
7a9db35c79 Fix shebang env (#817)
* fix: use /usr/bin/env to PATH search sh (nixos compatiblity)

* fix: reconcile repo hooks with template /usr/bin/env change
2026-01-01 10:54:22 -08:00
Steve Yegge
be0e8ba9af fix(sync): prevent circular error in pre-push hook (GH#532)
When bd sync pushes from the sync-branch worktree, the pre-push hook
would detect uncommitted JSONL changes and suggest running bd sync -
which is circular since that's what the user is already doing.

Fix: Set BD_SYNC_IN_PROGRESS=1 environment variable when pushing from
worktree, and update pre-push hook to skip checks when this var is set.

Updated files:
- internal/syncbranch/worktree.go: Set env var on push command
- cmd/bd/templates/hooks/pre-push: Check for env var and exit early
- examples/git-hooks/pre-push: Same check
- .beads-hooks/pre-push: Same check
2025-12-16 01:09:30 -08:00
Steve Yegge
6a024fb4d9 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>
2025-11-26 20:29:47 -08:00
Steve Yegge
106499c4fc Improve pre-push hook: suggest bd sync with auto-sync option
The pre-push hook now provides better guidance when beads JSONL has
uncommitted changes:

- Interactive terminals: Prompts to auto-run 'bd sync' (y/N)
- Non-interactive/CI: Shows 'bd sync' command to run
- Fallback: Manual git commands if bd not available

This addresses the UX issue where users weren't sure they should
run 'bd sync' instead of manual git commands.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 16:10:02 -08:00
Steve Yegge
1845b7d984 Add --shared flag to bd hooks install for versioned hooks
Implements support for installing git hooks to a versioned directory
(.beads-hooks/) that can be committed to the repository and shared with
team members. This solves the team collaboration issue where hooks need
to be installed in pre-built containers.

Changes:
- Add --shared flag to 'bd hooks install' command
- Install hooks to .beads-hooks/ when --shared is used
- Automatically configure git config core.hooksPath
- Update help text to explain shared mode

Fixes #229
2025-11-23 12:36:38 -08:00