{"record":{"id":"a333a028ffcc2a2e","repo":"jdx/mise","slug":"path-raw-id-block-source-and-line-are-mutua","errorCode":null,"errorMessage":"\"{path_raw}\".{id}: block/source and line are mutually exclusive, ignoring entry","messagePattern":"\"(.+?)\"\\.(.+?): block/source and line are mutually exclusive, ignoring entry","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/edits.rs","lineNumber":297,"sourceCode":"        config_root: crate::config::config_file::config_root::config_root(config_path),\n        environment: crate::config::environments_for_config_path(config_path),\n        source: None,\n    };\n    let entry = match entry {\n        EditTomlEntry::Block(inline) => EditTomlTable {\n            block: Some(inline),\n            source: None,\n            template: None,\n            line: None,\n            position: None,\n            comment: None,\n        },\n        EditTomlEntry::Table(table) => table,\n    };\n    let is_block = entry.block.is_some() || entry.source.is_some();\n    let op = match (&is_block, &entry.line) {\n        (true, Some(_)) => {\n            bail!(\n                \"\\\"{path_raw}\\\".{id}: block/source and line are mutually exclusive, ignoring entry\"\n            )\n        }\n        (false, None) => {\n            bail!(\n                \"\\\"{path_raw}\\\".{id}: no recognized operation (block, source, or line), ignoring entry\"\n            )\n        }\n        (true, None) => {\n            if entry.position.is_some() {\n                bail!(\"\\\"{path_raw}\\\".{id}: position is only valid with line, ignoring entry\")\n            }\n            let source = match (entry.block, entry.source) {\n                (Some(_), Some(_)) => {\n                    bail!(\n                        \"\\\"{path_raw}\\\".{id}: block and source are mutually exclusive, ignoring entry\"\n                    )\n                }","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/edits.rs#L279-L315","documentation":"In mise's dotfile-edit system, each `[dotfiles]` edit entry must specify exactly one operation: either block/source content or a single `line`. When `resolve_entry` (called while parsing config files in `edits_from_config_files`) sees an entry with `block` or `source` set AND a `line`, the entry is ambiguous, so mise bails and ignores that entry. This is a defensive parse-time validation to make edit semantics deterministic.","triggerScenarios":"A TOML edit entry defines both `line = \"...\"` and `block = \"...\"` (or `source = \"file\"`). `resolve_entry` matches `(is_block=true, Some(line))` and bails at src/system/edits.rs:297 during `edits_from_config_files`.","commonSituations":"Users copy a block-style entry and add a `line` field to tweak matching, or merge two config files (one using line edits, one using block edits) so a single entry ends up with both fields set.","solutions":["Remove the `line` field if you want a block/source (marker-wrapped) edit.","Remove the `block`/`source` fields if you want a single-line append/prepend edit.","Split into two separate edit entries if both operations are genuinely needed.","Re-run `mise edits` and confirm the entry is no longer reported as ignored."],"exampleFix":"# before\n[dotfiles.\"~/.zshrc\".my-edit]\nline = \"export FOO=1\"\nblock = \"export FOO=1\\nexport BAR=2\"\n\n# after\n[dotfiles.\"~/.zshrc\".my-edit]\nblock = \"export FOO=1\\nexport BAR=2\"","handlingStrategy":"validation","validationCode":"for (id, e) in &entries {\n    if (e.block.is_some() || e.source.is_some()) && e.line.is_some() {\n        return Err(format!(\"entry {id}: set either line OR block/source, not both\"));\n    }\n}","typeGuard":"fn is_block_entry(e: &EditEntry) -> bool { e.block.is_some() || e.source.is_some() }","tryCatchPattern":null,"preventionTips":["Use one operation field per entry; treat block/source and line as alternatives.","When converting a line edit to a block edit, delete the `line` key in the same change.","Run `mise edits` (diff mode) after editing config to catch ignored entries early."],"tags":["config","validation","dotfiles"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}