{"record":{"id":"c536501494c1701a","repo":"jdx/mise","slug":"comparing-checkpoints-requires-git","errorCode":null,"errorMessage":"comparing checkpoints requires git","messagePattern":"comparing checkpoints requires git","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/history/diff.rs","lineNumber":48,"sourceCode":"\n    /// Print the full patch instead of a per-file summary\n    #[usage(long, short)]\n    patch: bool,\n\n    /// Restrict to one path (a file or a directory)\n    #[usage(long, value_name = \"PATH\")]\n    path: Option<String>,\n\n    /// Exit 1 when the two sides differ\n    #[usage(long)]\n    exit_code: bool,\n}\n\nimpl HistoryDiff {\n    pub(crate) async fn run(self) -> Result<()> {\n        let (store, tracked, entries) = super::open().await?;\n        let Some(repo) = store.repo() else {\n            bail!(\"comparing checkpoints requires git\");\n        };\n        let path = self.path.as_deref().map(display_arg);\n        let (from, to, label) =\n            if self.operation {\n                if self.b.is_some() {\n                    bail!(\"--operation takes at most one checkpoint reference\");\n                }\n                let outcome = match &self.a {\n                    Some(reference) => super::resolve(reference, &entries, None)?,\n                    None => entries\n                        .iter()\n                        .rev()\n                        .find(|entry| entry.checkpoint.operation.is_some())\n                        .cloned()\n                        .ok_or_else(|| eyre::eyre!(\"no recorded operation\"))?,\n                };\n                let operation =\n                    outcome.checkpoint.operation.as_ref().ok_or_else(|| {","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/dotfiles/history/diff.rs#L30-L66","documentation":"`mise bootstrap dotfiles history diff` compares checkpoint snapshots stored in a git repository. If the checkpoint store has no git repo backing it (mise was built without git support or the store was never git-initialized), comparisons are impossible and mise throws \"comparing checkpoints requires git\".","triggerScenarios":"Running `mise bootstrap dotfiles history diff` (or `mise dotfiles diff`) when `store.repo()` returns None — i.e. the dotfiles history store is not backed by a git repository.","commonSituations":"A mise build without git support; a history store created without git initialization; a corrupted or moved history directory missing its `.git`.","solutions":["Ensure mise is built/installed with git support (use the standard release binaries).","Re-initialize the dotfiles history store so it is backed by a git repo.","Check the history store directory for a `.git` folder; if missing, recreate it via the history init path or restore from backup."],"exampleFix":"// before\nmise bootstrap dotfiles history diff  # comparing checkpoints requires git\n// after\n# verify store has git backing, or reinstall standard mise build\nmise bootstrap dotfiles history list\nmise bootstrap dotfiles history diff","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"# shell\nif ! mise bootstrap dotfiles history diff \"$@\" 2>&1 | grep -q 'requires git'; then\n  : # success\nelse\n  echo \"git-backed history unavailable; showing journal instead\"\n  mise bootstrap dotfiles history ls\nfi","preventionTips":["Use standard mise builds that include git support.","Keep the dotfiles history store in place with its git metadata intact."],"tags":["dotfiles","git","history"],"backgroundTag":"missing-dependency","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"}