jdx/mise · error

: multiple [dotfiles] edit entries match; choose one of

Error message

{raw}: multiple [dotfiles] edit entries match; choose one of: {keys}

What it means

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.

Solutions

  1. List the printed candidate keys and pick one explicitly in the command/config
  2. Remove the duplicate [dotfiles] entry from mise.toml (`mise dotfiles rm <key>` or manual edit)
  3. Use `mise config ls` / edit ~/.config/mise/mise.toml to consolidate overlapping entries

Example fix

// before: mise.toml
[dotfiles.zshrc]
source = "~/dotfiles/zshrc"
[dotfiles.zshrc-copy]
source = "~/dotfiles/zshrc"
// after: keep one entry
[dotfiles.zshrc]
source = "~/dotfiles/zshrc"
Defensive patterns

Strategy: validation

Validate before calling

grep -c "$target" ~/.config/mise/mise.toml  # >1 likely duplicate [dotfiles] entries

Try / catch

match Err(msg) if msg.contains("multiple [dotfiles] edit entries match") => parse keys from message and prompt user to choose

Prevention

When it happens

Trigger: `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.

Common situations: 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.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/ae2ddafd7be25634. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/dotfiles/edit.rs:148

            return Ok(Some(match &req.op {
                EditOp::Block {
                    source: BlockSource::File(path),
                    ..
                } => path.clone(),
                EditOp::Block {
                    source: BlockSource::Inline(_),
                    ..
                }
                | EditOp::Line { .. } => req.config_path.clone(),
            }));
        }
        edits => {
            let keys = edits
                .iter()
                .map(|req| req.config_key())
                .collect::<Vec<_>>()
                .join(", ");
            bail!("{raw}: multiple [dotfiles] edit entries match; choose one of: {keys}");
        }
    }
    if target.is_relative() {
        bail!("{raw}: target must be absolute or start with ~/");
    }
    Ok(None)
}

fn open_or_create(path: &std::path::Path) -> Result<()> {
    if !path.exists() {
        if let Some(parent) = path.parent() {
            file::create_dir_all(parent)?;
        }
        file::write(path, "")?;
    }
    Ok(())
}

View on GitHub (pinned to 533346cc37)