{"record":{"id":"8982e95d26fbad3b","repo":"gastownhall/beads","slug":"s-does-not-require-migration","errorCode":null,"errorMessage":"%s does not require migration","messagePattern":"(.+?) does not require migration","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"info","filePath":"cmd/bd/migrate_hooks_apply.go","lineNumber":225,"sourceCode":"\t}\n\treturn fmt.Sprintf(\"%s (%s): %s\", hook.Name, hook.State, suggestion)\n}\n\nfunc chooseHookMigrationWriteSource(hook doctor.HookMigrationHookPlan) (hookMigrationWriteSource, string, error) {\n\tswitch hook.State {\n\tcase \"legacy_only\":\n\t\treturn hookMigrationWriteFromTemplate, \"\", nil\n\tcase \"legacy_with_old_sidecar\", \"legacy_with_both_sidecars\", \"missing_with_old_sidecar\", \"missing_with_both_sidecars\":\n\t\treturn hookMigrationWriteFromOld, hook.HookPath + \".old\", nil\n\tcase \"legacy_with_backup_sidecar\", \"missing_with_backup_sidecar\":\n\t\treturn hookMigrationWriteFromBackup, hook.HookPath + \".backup\", nil\n\tcase \"custom_with_sidecars\":\n\t\treturn hookMigrationWriteFromHookFile, hook.HookPath, nil\n\tdefault:\n\t\tif hook.NeedsMigration {\n\t\t\treturn \"\", \"\", fmt.Errorf(\"%s has unsupported migration state %q\", hook.Name, hook.State)\n\t\t}\n\t\treturn \"\", \"\", fmt.Errorf(\"%s does not require migration\", hook.Name)\n\t}\n}\n\ntype preparedHookWrite struct {\n\tHookName string\n\tPath     string\n\tContent  []byte\n}\n\nfunc applyHookMigrationExecution(execPlan hookMigrationExecutionPlan) (hookMigrationApplySummary, error) {\n\tif len(execPlan.BlockingErrors) > 0 {\n\t\treturn hookMigrationApplySummary{}, fmt.Errorf(\n\t\t\t\"hook migration blocked by %d issue(s): %s\",\n\t\t\tlen(execPlan.BlockingErrors),\n\t\t\tstrings.Join(execPlan.BlockingErrors, \"; \"),\n\t\t)\n\t}\n","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/migrate_hooks_apply.go#L207-L243","documentation":"The sibling of the unsupported-state error: when the hook's State falls into the default case AND NeedsMigration is false, the hook is already migrated (or was never managed), so applying a migration is a no-op request. bd refuses with this explicit message instead of overwriting a hook that doesn't need changes.","triggerScenarios":"Running `bd migrate hooks apply` (or fixPendingMigrations) for a hook whose detected state is not one of the pending-migration states and whose NeedsMigration flag is false — e.g. already migrated, custom hook without sidecars, or user-managed hook.","commonSituations":"Re-running apply after a successful migration; applying migration to a repo whose hooks were installed by another tool; scripting apply across many repos where some are already done.","solutions":["Nothing to fix — the hook is already migrated; skip it","Use the plan/dry-run output to filter which hooks actually need migration before applying","Check the hook's detected state (`bd migrate hooks` list) before forcing apply","If the hook should be managed by bd, re-install it from template rather than applying migration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// filter to hooks that actually need migration\nconst pending = hooks.filter(h => h.NeedsMigration);\napplyMigration(pending);","typeGuard":"function needsMigration(h) { return h.NeedsMigration === true }","tryCatchPattern":"if err := apply(h); err != nil && strings.Contains(err.Error(), \"does not require migration\") {\n    // treat as success / skip\n    continue\n}","preventionTips":["Run plan first and apply only NeedsMigration hooks","Make apply scripts idempotent and tolerant of this message","Don't blindly apply across repos with mixed migration states"],"tags":["migration","git-hooks","no-op"],"backgroundTag":"migration-not-required","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}