{"record":{"id":"9bb3975126b21fa8","repo":"jdx/mise","slug":"files-cannot-diff-these-entries-fix-them-manuall","errorCode":null,"errorMessage":"files: cannot diff these entries, fix them manually:\n{}","messagePattern":"files: cannot diff these entries, fix them manually:\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/files.rs","lineNumber":3033,"sourceCode":"            },\n            _ => None,\n        };\n        match check_rendered(req, rendered.as_deref()) {\n            Ok(FileState::Applied) => continue,\n            Ok(_) => {}\n            Err(err) => {\n                problems.push(format!(\"  \\\"{}\\\": {err}\", req.target_raw));\n                continue;\n            }\n        }\n        changed = true;\n        miseprintln!(\"dotfile differs: {}\", req.target.display_user());\n        if let Err(err) = print_diff(req, rendered.as_deref()) {\n            problems.push(format!(\"  \\\"{}\\\": {err}\", req.target_raw));\n        }\n    }\n    if !problems.is_empty() {\n        bail!(\n            \"files: cannot diff these entries, fix them manually:\\n{}\",\n            problems.join(\"\\n\")\n        );\n    }\n    if !changed {\n        info!(\"files: all files are applied\");\n    }\n    Ok(())\n}\n\nconst DOTFILES_PART: &str = \"dotfiles\";\n\n/// Every path `apply_one` may create, replace, or remove for `req`, with how\n/// deeply to capture it first: a path that gets replaced is captured whole,\n/// a directory that stays a directory only by existence.\nfn touched_paths(req: &FileRequest) -> Result<Vec<(PathBuf, Capture)>> {\n    let mut paths: IndexMap<PathBuf, Capture> = IndexMap::new();\n    for dir in missing_ancestors(&req.target) {","sourceCodeStart":3015,"sourceCodeEnd":3051,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/files.rs#L3015-L3051","documentation":"In mise's `files diff` command (src/system/files.rs:3033), per-entry diffs are attempted; when printing a diff fails for an entry (e.g. the entry cannot be rendered or diffed), the command collects the problems and bails listing them all, telling the user to fix them manually. It fires only after individual diff attempts failed, aggregating every failing entry into one message.","triggerScenarios":"`mise bootstrap dotfiles diff` where print_diff (or rendering within it) returns Err for one or more FileRequests — e.g. a template whose rendering executes a failing command, or unreadable/unrenderable entries — producing a non-empty `problems` list.","commonSituations":"A template mode entry whose embedded command fails during rendering; a target/source pair in an inconsistent state (missing source, unreadable file); entries modified so drastically that the differ cannot produce output.","solutions":["Fix each listed entry manually (the message names them by their raw target path)","Inspect the per-entry cause — the underlying err from print_diff is embedded in the listing","If a template command fails, fix the command in the template source, then rerun diff","Remove or correct the broken entry in mise.toml if it is obsolete"],"exampleFix":"# output\n# files: cannot diff these entries, fix them manually:\n#   \"~/.zshrc\": template command failed\n\n# after: fix the template command in the source, then\nmise bootstrap dotfiles diff","handlingStrategy":"try-catch","validationCode":"for (const e of entries) {\n  if (e.mode === 'template' && templateHasCommands(e.source)) {\n    console.warn(`entry ${e.target} renders commands; diff may fail`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await diff();\n} catch (e) {\n  if (String(e).startsWith('files: cannot diff these entries')) {\n    // parse the listed entries from the message and fix them manually\n  } else throw e;\n}","preventionTips":["Keep template embedded commands working (test them standalone)","Fix entries reported by `dotfiles status` before running diff","Avoid unreadable or missing sources/targets in managed entries"],"tags":["dotfiles","diff","template"],"backgroundTag":"diff-print-failed","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}