fix(doctor): make sync-branch warning optional
Users with workflows that don't need sync-branch (e.g., Graphite PR stacking, single-clone setups) were seeing confusing warnings. Changes: - Remove checkSyncBranchQuick() - no longer warn on every bd command - Change bd doctor from warning to OK status for missing sync-branch - Update message to "Not configured (optional)" Fixes #498 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -462,12 +462,7 @@ func runCheckHealth(path string) {
|
||||
issues = append(issues, issue)
|
||||
}
|
||||
|
||||
// Check 2: Sync branch not configured (now reads from config.yaml, not DB)
|
||||
if issue := checkSyncBranchQuick(); issue != "" {
|
||||
issues = append(issues, issue)
|
||||
}
|
||||
|
||||
// Check 3: Outdated git hooks
|
||||
// Check 2: Outdated git hooks
|
||||
if issue := checkHooksQuick(path); issue != "" {
|
||||
issues = append(issues, issue)
|
||||
}
|
||||
@@ -526,15 +521,6 @@ func checkVersionMismatchDB(db *sql.DB) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// checkSyncBranchQuick checks if sync-branch is configured in config.yaml.
|
||||
// Fast check that doesn't require database access.
|
||||
func checkSyncBranchQuick() string {
|
||||
if syncbranch.IsConfigured() {
|
||||
return ""
|
||||
}
|
||||
return "sync-branch not configured in config.yaml"
|
||||
}
|
||||
|
||||
// checkHooksQuick does a fast check for outdated git hooks.
|
||||
// Checks all beads hooks: pre-commit, post-merge, pre-push, post-checkout (bd-2em).
|
||||
func checkHooksQuick(path string) string {
|
||||
@@ -2343,26 +2329,20 @@ func checkSyncBranchConfig(path string) doctorCheck {
|
||||
}
|
||||
}
|
||||
|
||||
// Not configured - this is optional but recommended for multi-clone setups
|
||||
// Check if this looks like a multi-clone setup (has remote)
|
||||
hasRemote := false
|
||||
// Not configured - check if repo has a remote to provide appropriate message
|
||||
// sync-branch is optional, only needed for protected branches or multi-clone workflows
|
||||
// See GitHub issue #498
|
||||
cmd = exec.Command("git", "remote")
|
||||
cmd.Dir = path
|
||||
if output, err := cmd.Output(); err == nil && len(strings.TrimSpace(string(output))) > 0 {
|
||||
hasRemote = true
|
||||
}
|
||||
|
||||
if hasRemote {
|
||||
return doctorCheck{
|
||||
Name: "Sync Branch Config",
|
||||
Status: statusWarning,
|
||||
Message: "sync-branch not configured",
|
||||
Detail: "Multi-clone setups should configure sync-branch in config.yaml",
|
||||
Fix: "Add 'sync-branch: beads-sync' to .beads/config.yaml",
|
||||
Status: statusOK,
|
||||
Message: "Not configured (optional)",
|
||||
Detail: "Only needed for protected branches or multi-clone workflows",
|
||||
}
|
||||
}
|
||||
|
||||
// No remote - probably a local-only repo, sync-branch not needed
|
||||
return doctorCheck{
|
||||
Name: "Sync Branch Config",
|
||||
Status: statusOK,
|
||||
|
||||
Reference in New Issue
Block a user