jdx/mise · error

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

Error message

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

What it means

mise's `edits` diff printer (print_diffs) renders a unified diff of managed edits, but some EditRequests cannot be turned into a patch — for example symlinked targets, which mise refuses to rewrite. Before printing, any requests that produced problems are reported so the user can fix those files by hand, and the command aborts with this error listing them.

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 afd2eddd3a)

Solutions

  1. Read the listed entries and determine why each cannot be diffed (usually symlink).
  2. Edit the symlink's real target file manually, or remove the symlink so the file is a regular file mise can edit.
  3. Remove the edit/block declaration from mise.toml if the file is intentionally managed by another tool.
  4. Re-run `mise edits diff` to confirm the problem list is empty.

Example fix

// before: mise.toml manages a block in ~/.zshrc which is a symlink to ~/dotfiles/zshrc
[edits]
"~/.zshrc" = { block = "..." }

// after: point the edit at the real file (or de-symlink ~/.zshrc)
[edits]
"~/dotfiles/zshrc" = { block = "..." }
Defensive patterns

Strategy: validation

Validate before calling

# before diffing, ensure every edit target is a regular file
for f in ~/.zshrc ~/.gitconfig; do
  [ -L "$f" ] && echo "symlinked, fix manually: $f"
done

Type guard

const isRegularFile = (p: string) => fs.lstatSync(p).isFile(); // lstat: symlink fails

Prevention

When it happens

Trigger: Calling `mise edits diff` (print_diffs) when one or more edit requests hit a precheck problem — typically the target path is a symlink (SYMLINK_REASON: "target is a symlink; edit the real file instead") — so create_patch/rewrite cannot safely proceed.

Common situations: A dotfile was replaced by a symlink (e.g. by stow, GNU stow, or another dotfile manager, or by mise's own dotfiles symlink modes) while it is also declared as a managed edit; the user then runs `mise edits diff` and gets this error naming the affected entries.

Related errors


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