diff --git a/cmd/bd/doctor/git.go b/cmd/bd/doctor/git.go index 756bb023..b46e7224 100644 --- a/cmd/bd/doctor/git.go +++ b/cmd/bd/doctor/git.go @@ -800,7 +800,16 @@ func CheckGitHooksDoltCompatibility(path string) DoctorCheck { contentStr := string(content) - // Check if it's a bd hook + // Shim hooks (bd-shim) delegate to 'bd hook' which handles Dolt correctly + if strings.Contains(contentStr, bdShimMarker) { + return DoctorCheck{ + Name: "Git Hooks Dolt Compatibility", + Status: StatusOK, + Message: "Shim hooks (Dolt handled by bd hook command)", + } + } + + // Check if it's a bd inline hook if !strings.Contains(contentStr, bdInlineHookMarker) && !strings.Contains(contentStr, "bd") { return DoctorCheck{ Name: "Git Hooks Dolt Compatibility", @@ -809,12 +818,12 @@ func CheckGitHooksDoltCompatibility(path string) DoctorCheck { } } - // Check if it has the Dolt backend skip logic + // Check if inline hook has the Dolt backend skip logic if strings.Contains(contentStr, `"backend"`) && strings.Contains(contentStr, `"dolt"`) { return DoctorCheck{ Name: "Git Hooks Dolt Compatibility", Status: StatusOK, - Message: "Hooks have Dolt backend check", + Message: "Inline hooks have Dolt backend check", } } diff --git a/cmd/bd/migrate_dolt.go b/cmd/bd/migrate_dolt.go index 834c208f..7476ac40 100644 --- a/cmd/bd/migrate_dolt.go +++ b/cmd/bd/migrate_dolt.go @@ -172,16 +172,24 @@ func hooksNeedDoltUpdate(beadsDir string) bool { return false // No hook installed } - // Check if it's a bd hook and lacks the Dolt skip logic contentStr := string(content) + + // Shim hooks (bd-shim) delegate to 'bd hook' which handles Dolt correctly + if strings.Contains(contentStr, "bd-shim") { + return false // Shim hooks are fine + } + + // Check if it's a bd inline hook if !strings.Contains(contentStr, "bd") { return false // Not a bd hook } + + // Check if inline hook has the Dolt skip logic if strings.Contains(contentStr, `"backend"`) && strings.Contains(contentStr, `"dolt"`) { return false // Already has Dolt check } - return true // bd hook without Dolt check + return true // bd inline hook without Dolt check } // handleToSQLiteMigration migrates from Dolt to SQLite backend (escape hatch).