{"record":{"id":"85fb0cc11a6235b0","repo":"gastownhall/beads","slug":"a-resolution-strategy-is-required-ours-or-the","errorCode":null,"errorMessage":"a resolution strategy is required: --ours or --theirs","messagePattern":"a resolution strategy is required: --ours or --theirs","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/conflicts.go","lineNumber":677,"sourceCode":"// resolveStrategy reads the strategy from --ours/--theirs/--strategy.\nfunc resolveStrategy() (string, error) {\n\tpicked := \"\"\n\tswitch {\n\tcase conflictsResolveOurs && conflictsResolveTheirs:\n\t\treturn \"\", fmt.Errorf(\"pass --ours or --theirs, not both\")\n\tcase conflictsResolveOurs:\n\t\tpicked = versioncontrolops.ConflictStrategyOurs\n\tcase conflictsResolveTheirs:\n\t\tpicked = versioncontrolops.ConflictStrategyTheirs\n\t}\n\tif conflictsResolveStrat != \"\" {\n\t\tif picked != \"\" && picked != conflictsResolveStrat {\n\t\t\treturn \"\", fmt.Errorf(\"--strategy %s contradicts --%s\", conflictsResolveStrat, picked)\n\t\t}\n\t\tpicked = conflictsResolveStrat\n\t}\n\tif picked == \"\" {\n\t\treturn \"\", fmt.Errorf(\"a resolution strategy is required: --ours or --theirs\")\n\t}\n\tif err := versioncontrolops.ValidateConflictStrategy(picked); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn picked, nil\n}\n\n// filterShownFields drops the agreeing fields from JSON output unless the\n// caller asked for all of them, so a conflict reads as its handful of\n// diverged fields rather than the whole row.\nfunc filterShownFields(rows []storage.ConflictRow, allFields bool) []storage.ConflictRow {\n\tif allFields {\n\t\treturn rows\n\t}\n\tout := make([]storage.ConflictRow, 0, len(rows))\n\tfor _, r := range rows {\n\t\ttrimmed := r\n\t\ttrimmed.Fields = differingFields(r.Fields)","sourceCodeStart":659,"sourceCodeEnd":695,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/conflicts.go#L659-L695","documentation":"After checking --ours, --theirs, and --strategy, resolveStrategy requires at least one of them. If none was supplied, picked remains empty and this error tells the user that a resolution strategy is mandatory for conflict resolution. It is the 'missing required argument' guard of the conflicts resolve command.","triggerScenarios":"Running `bd conflicts resolve` (or the code path calling resolveStrategy) without any of --ours, --theirs, or --strategy, so all three flag variables are empty and picked == \"\" at the final check.","commonSituations":"Interactive users omitting flags expecting a prompt that does not happen; scripts built before a strategy flag became required; accidental flag typo like --stratey that silently yields no strategy.","solutions":["Add --ours or --theirs to the resolve command","Or add --strategy ours|theirs to the resolve command","Fix typos in the flag name so one of the recognized flags is actually parsed"],"exampleFix":"// before\nbd conflicts resolve bd-123\n// after\nbd conflicts resolve bd-123 --strategy theirs","handlingStrategy":"validation","validationCode":"# ensure exactly one strategy flag is present before invoking\n[ -n \"$OURS\" ] || [ -n \"$THEIRS\" ] || [ -n \"$STRAT\" ] || { echo \"a resolution strategy is required: --ours or --theirs\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":"if err := resolveStrategy(); err != nil {\n  if strings.Contains(err.Error(), \"resolution strategy is required\") {\n    return fmt.Errorf(\"usage: bd conflicts resolve <id> --ours|--theirs|--strategy <s>: %w\", err)\n  }\n  return err\n}","preventionTips":["Always pass --strategy (or --ours/--theirs) explicitly in automation","Check flag spelling — a typo silently leaves the strategy empty","Use --help to confirm required flags before scripting the command"],"tags":["cli","missing-argument","conflict-resolution","required-flag"],"backgroundTag":"missing-required-argument","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}