{"record":{"id":"ae2ddafd7be25634","repo":"jdx/mise","slug":"raw-multiple-dotfiles-edit-entries-match-cho","errorCode":null,"errorMessage":"{raw}: multiple [dotfiles] edit entries match; choose one of: {keys}","messagePattern":"(.+?): multiple \\[dotfiles\\] edit entries match; choose one of: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/edit.rs","lineNumber":148,"sourceCode":"            return Ok(Some(match &req.op {\n                EditOp::Block {\n                    source: BlockSource::File(path),\n                    ..\n                } => path.clone(),\n                EditOp::Block {\n                    source: BlockSource::Inline(_),\n                    ..\n                }\n                | EditOp::Line { .. } => req.config_path.clone(),\n            }));\n        }\n        edits => {\n            let keys = edits\n                .iter()\n                .map(|req| req.config_key())\n                .collect::<Vec<_>>()\n                .join(\", \");\n            bail!(\"{raw}: multiple [dotfiles] edit entries match; choose one of: {keys}\");\n        }\n    }\n    if target.is_relative() {\n        bail!(\"{raw}: target must be absolute or start with ~/\");\n    }\n    Ok(None)\n}\n\nfn open_or_create(path: &std::path::Path) -> Result<()> {\n    if !path.exists() {\n        if let Some(parent) = path.parent() {\n            file::create_dir_all(parent)?;\n        }\n        file::write(path, \"\")?;\n    }\n    Ok(())\n}\n","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/dotfiles/edit.rs#L130-L166","documentation":"source_for_target resolves a user-supplied path to the [dotfiles] edit entries it matches. When more than one entry matches the same target, it cannot pick one and bails listing the candidate config keys so the user can disambiguate.","triggerScenarios":"`mise dotfiles edit <path>` where the path (or its normalized/~/ form) matches config_key() of two or more [dotfiles] entries — typically overlapping entries or the same file registered under multiple keys.","commonSituations":"Duplicate [dotfiles] entries added twice under different keys pointing at the same file; a directory entry and a file entry that both match; copy-pasted config blocks in mise.toml.","solutions":["List the printed candidate keys and pick one explicitly in the command/config","Remove the duplicate [dotfiles] entry from mise.toml (`mise dotfiles rm <key>` or manual edit)","Use `mise config ls` / edit ~/.config/mise/mise.toml to consolidate overlapping entries"],"exampleFix":"// before: mise.toml\n[dotfiles.zshrc]\nsource = \"~/dotfiles/zshrc\"\n[dotfiles.zshrc-copy]\nsource = \"~/dotfiles/zshrc\"\n// after: keep one entry\n[dotfiles.zshrc]\nsource = \"~/dotfiles/zshrc\"","handlingStrategy":"validation","validationCode":"grep -c \"$target\" ~/.config/mise/mise.toml  # >1 likely duplicate [dotfiles] entries","typeGuard":null,"tryCatchPattern":"match Err(msg) if msg.contains(\"multiple [dotfiles] edit entries match\") => parse keys from message and prompt user to choose","preventionTips":["Avoid duplicate [dotfiles] entries pointing at the same file","Review mise.toml after scripted config edits","Deduplicate with `mise dotfiles rm` before editing"],"tags":["dotfiles","config","ambiguity"],"backgroundTag":"conflicting-config-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"}