Add git hooks check to bd doctor

- Adds checkGitHooks() function to verify recommended hooks are installed
- Checks for pre-commit, post-merge, and pre-push hooks
- Warns if hooks are missing with install instructions
- Shows up early in diagnostics (even if .beads/ missing)
- Includes comprehensive test coverage
- Filed bd-6049 for broken --json flag

🤖 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-02 17:08:47 -08:00
parent 6353873e72
commit dfc8e48b57
5 changed files with 512 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
---
description: Synchronize issues with git remote
argument-hint: [--dry-run] [--message]
argument-hint: [--dry-run] [--message] [--status] [--merge]
---
Synchronize issues with git remote in a single operation.
@@ -22,6 +22,32 @@ Wraps the entire git-based sync workflow for multi-device use.
- **Custom message**: `bd sync --message "Closed sprint issues"`
- **Pull only**: `bd sync --no-push`
- **Push only**: `bd sync --no-pull`
- **Flush only**: `bd sync --flush-only` (export to JSONL without git operations)
- **Import only**: `bd sync --import-only` (import from JSONL without git operations)
## Separate Branch Workflow
When using a separate sync branch (configured via `sync.branch`), additional commands are available:
- **Check status**: `bd sync --status` - Show diff between sync branch and main
- **Merge to main**: `bd sync --merge` - Merge sync branch back to main branch
- **Preview merge**: `bd sync --merge --dry-run` - Preview what would be merged
### Merge Workflow
When working with a protected main branch and separate sync branch:
1. Beads commits go to the sync branch (e.g., `beads-metadata`)
2. Use `bd sync --status` to review pending changes
3. When ready, use `bd sync --merge` to merge back to main
4. After merge, run `bd import` to update the database
5. Run `bd sync` to push changes to remote
The merge command includes safety checks:
- Verifies you're not on the sync branch
- Checks for uncommitted changes in working tree
- Detects and reports merge conflicts with resolution steps
- Uses `--no-ff` to create a merge commit for clear history
## Note