{"record":{"id":"e32305ab4198597f","repo":"gastownhall/beads","slug":"invalid-dolt-auto-commit-q-valid-off-on-bat","errorCode":null,"errorMessage":"invalid --dolt-auto-commit=%q (valid: off, on, batch)","messagePattern":"invalid --dolt-auto-commit=%q \\(valid: off, on, batch\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/dolt_autocommit_config.go","lineNumber":31,"sourceCode":"\tdoltAutoCommitBatch doltAutoCommitMode = \"batch\"\n)\n\nfunc getDoltAutoCommitMode() (doltAutoCommitMode, error) {\n\tmode := strings.TrimSpace(strings.ToLower(doltAutoCommit))\n\tif mode == \"\" {\n\t\t// Default resolved at store-creation time in main.go based on server mode.\n\t\t// If still empty here, fall back to off (safe default).\n\t\tmode = string(doltAutoCommitOff)\n\t}\n\tswitch doltAutoCommitMode(mode) {\n\tcase doltAutoCommitOff:\n\t\treturn doltAutoCommitOff, nil\n\tcase doltAutoCommitOn:\n\t\treturn doltAutoCommitOn, nil\n\tcase doltAutoCommitBatch:\n\t\treturn doltAutoCommitBatch, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"invalid --dolt-auto-commit=%q (valid: off, on, batch)\", doltAutoCommit)\n\t}\n}\n","sourceCodeStart":13,"sourceCodeEnd":34,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/dolt_autocommit_config.go#L13-L34","documentation":"getDoltAutoCommitMode validates the --dolt-auto-commit flag value and rejects anything other than the three allowed modes: off, on, or batch. This is pure input validation: the flag string did not match any known mode constant. The error names the invalid value and the valid options so the user can correct the command line.","triggerScenarios":"Passing --dolt-auto-commit with a misspelled or unsupported value, e.g. --dolt-auto-commit=auto, --dolt-auto-commit=OFF (case-sensitive), or an empty string from an env/config source feeding the flag.","commonSituations":"Typo in scripts or CI pipelines; copy-pasting config from older bd versions where different mode names existed; setting BD_DOLT_AUTO_COMMIT-like env values with wrong casing.","solutions":["Use one of exactly off, on, or batch (lowercase) for --dolt-auto-commit","Check the script/CI config for typos or stray whitespace in the flag value","Run bd dolt --help (or the wrapping command's help) to confirm accepted values"],"exampleFix":"// before\nbd push --dolt-auto-commit=auto\n// after\nbd push --dolt-auto-commit=batch","handlingStrategy":"validation","validationCode":"func validAutoCommit(v string) bool {\n    switch v { case \"off\", \"on\", \"batch\": return true }\n    return false\n}\nif !validAutoCommit(flagVal) { return fmt.Errorf(\"invalid --dolt-auto-commit=%q (valid: off, on, batch)\", flagVal) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use the literal strings off, on, batch (lowercase) in scripts and CI","Centralize flag values in a config constant rather than hand-writing them per job","Validate config files at startup with the same mode constants"],"tags":["cli","validation","flags","dolt"],"backgroundTag":"invalid-flag-value","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}