{"record":{"id":"c536501494c1701a","repo":"jdx/mise","slug":"comparing-checkpoints-requires-git","errorCode":null,"errorMessage":"comparing checkpoints requires git","messagePattern":"comparing checkpoints requires git","errorType":"console","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/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/dotfiles/history/diff.rs#L30-L66","documentation":"`mise dotfiles history diff` compares checkpoints stored in a git-backed snapshot store. If the store has no underlying git repository (git backend unavailable or store initialized without git), the comparison cannot run and run() bails immediately.","triggerScenarios":"Running `mise dotfiles history diff ...` when store.repo() returns None — git not installed, or the dotfiles history store was created in a mode without git backing.","commonSituations":"Git missing from PATH in minimal containers/CI; corrupted or partially deleted checkpoint store directory missing .git; user disabled git-backed snapshots.","solutions":["Install git and ensure it is on PATH","Re-initialize the dotfiles history store so it is git-backed","Verify the store directory contains a valid .git (or recreate it)"],"exampleFix":"// before: container without git\nmise dotfiles history diff a b   // bails\n// after\napt-get install -y git\nmise dotfiles history diff a b","handlingStrategy":"fallback","validationCode":"command -v git >/dev/null 2>&1 || echo 'git required for history diff'","typeGuard":null,"tryCatchPattern":"if let Err(e) = diff_run() { if e.to_string().contains(\"requires git\") { eprintln!(\"install git or use journal-only view\"); } }","preventionTips":["Install git wherever you use dotfiles checkpoints","Do not delete the store's .git directory","Check git availability in CI images before dotfiles commands"],"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"}