{"record":{"id":"24a0efb7a936cb0d","repo":"jdx/mise","slug":"listing-snapshot-files-requires-git","errorCode":null,"errorMessage":"listing snapshot files requires git","messagePattern":"listing snapshot files requires git","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/history/show.rs","lineNumber":148,"sourceCode":"        }\n        for incomplete in &coverage.incomplete {\n            miseprintln!(\"  incomplete: {} ({})\", incomplete.path, incomplete.reason);\n        }\n        if let Some(operation) = &c.operation\n            && !operation.journal.is_empty()\n        {\n            miseprintln!(\"\");\n            miseprintln!(\"Journal:\");\n            for line in journal::render(&operation.journal) {\n                miseprintln!(\"  - {line}\");\n            }\n        }\n        if self.files {\n            let Some(tree) = &c.tree.snapshot else {\n                bail!(\"checkpoint {} has no content snapshot\", entry.id);\n            };\n            let Some(repo) = store.repo() else {\n                bail!(\"listing snapshot files requires git\");\n            };\n            miseprintln!(\"\");\n            miseprintln!(\"Files:\");\n            for file in repo.ls_tree(tree)? {\n                let size = file.size.map(|size| size.to_string()).unwrap_or_default();\n                miseprintln!(\n                    \"  {} {:>8} {}\",\n                    file.mode,\n                    size,\n                    crate::system::history::tracked::tree_path_to_display(&file.path)\n                );\n            }\n        }\n        Ok(())\n    }\n}\n\npub(crate) fn policy(autosave: bool) -> String {","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/dotfiles/history/show.rs#L130-L166","documentation":"When `history show --files` finds a content snapshot tree reference, it still needs the git repository to run ls-tree. If store.repo() is None (no git backing), listing is impossible and run() bails with this message.","triggerScenarios":"`mise dotfiles history show <id> --files` where the checkpoint has a snapshot but store.repo() returns None — git binary unavailable or the store lacks a git repo despite having snapshot metadata.","commonSituations":"Git removed from PATH after checkpoints were created; store moved/copied without its .git directory; CI containers lacking git.","solutions":["Install/restore git so it is on PATH","Restore the store's .git directory or reinitialize the history store","Use the journal output without --files as a fallback"],"exampleFix":"// before: git missing\nmise dotfiles history show ckpt123 --files   // bails\n// after\nexport PATH=\"$PATH:/usr/bin\"  # or install git\nmise dotfiles history show ckpt123 --files","handlingStrategy":"fallback","validationCode":"command -v git >/dev/null 2>&1 || echo 'git required to list snapshot files'","typeGuard":null,"tryCatchPattern":"if let Err(e) = show_files() { if e.to_string().contains(\"requires git\") { eprintln!(\"install git, or use journal output\"); } }","preventionTips":["Keep git on PATH on all machines sharing the dotfiles store","Copy stores with their .git directory","Verify git in CI/container images before --files usage"],"tags":["git","dotfiles","dependency"],"backgroundTag":"missing-dependency","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"}