jdx/mise · error

edits: cannot diff these entries, fix them manually

Error message

edits: cannot diff these entries, fix them manually:
{}

What it means

`print_diffs` computes what each `[dotfiles]` edit would change, but entries that failed validation (collected in `problems`) have no well-defined diff. After printing diffs for the valid entries, it bails with an aggregated message listing the un-diffable entries so the user knows which entries to fix manually. Unlike `apply`, the diffs for healthy entries are still printed before the error.

Solutions

  1. Fix each entry named in the problem list (per the earlier validation rules: one operation per entry, valid position/template values, no self-referential markers).
  2. Repair the target file's managed region manually if the problem concerns reconciling existing content.
  3. Re-run `mise edits` to preview again, then apply once no problems remain.

Example fix

# before (config that cannot be diffed)
[dotfiles."~/.gitconfig".bad]
block = "[alias]\n  st = status"
position = "append"

# after
[dotfiles."~/.gitconfig".bad]
block = "[alias]\n  st = status"
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure every entry resolves cleanly before requesting diffs
for (id, e) in &entries {
    if (e.block.is_some() || e.source.is_some()) && (e.line.is_some() || e.position.is_some()) {
        return Err(format!("entry {id}: block/source entries take no line/position"));
    }
}

Try / catch

match mise_edits_diff() {
    Err(e) if e.to_string().starts_with("edits: cannot diff these entries") => {
        // diffs for healthy entries were already printed; fix the listed entries
    }
    other => other?,
}

Prevention

When it happens

Trigger: Running `mise edits` (diff mode) while any entry fails validation or its target content cannot be reconciled; `print_diffs` finishes emitting valid patches, then bails at src/system/edits.rs:852 with the joined problem list.

Common situations: Previewing edits after a config edit introduced an invalid entry (both block and line set, unknown position/engine, markers inside content), or a target file was hand-modified so the managed region no longer matches.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at src/system/edits.rs:852

        }
        changed = true;
        miseprintln!(
            "edit differs: {} ({})",
            req.path.display_user(),
            req.describe_op()
        );
        let mut opts = diffy::DiffOptions::new();
        opts.set_original_filename(format!("{} (current)", req.path.display_user()))
            .set_modified_filename(format!(
                "{} (desired: {})",
                req.path.display_user(),
                req.describe_op()
            ));
        let patch = opts.create_patch(&current, &output);
        miseprint!("{}", diffy::PatchFormatter::new().fmt_patch(&patch))?;
    }
    if !problems.is_empty() {
        bail!(
            "edits: cannot diff these entries, fix them manually:\n{}",
            problems.join("\n")
        );
    }
    if !changed {
        info!("edits: all edits are applied");
    }
    Ok(())
}

pub(crate) struct UnapplyOpts {
    pub dry_run: bool,
    pub verbose: bool,
    /// plain line edits have no ownership marker, so removing them requires
    /// explicit confirmation that the configured line should be removed
    pub force: bool,
    pub yes: bool,
}

View on GitHub (pinned to 533346cc37)