{"record":{"id":"0e4e6ba2ae5609fe","repo":"jdx/mise","slug":"path-is-not-in-either-snapshot-0e4e6b","errorCode":null,"errorMessage":"path is not in either snapshot","messagePattern":"path is not in either snapshot","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/shadow.rs","lineNumber":1202,"sourceCode":"            (b, opts.paths.as_ref().map(|p| p.1.as_str())),\n        ] {\n            for entry in self.ls_tree(tree)? {\n                if entry.path.starts_with(\".mise-history/\") {\n                    continue;\n                }\n                if let Some(prefix) = prefix {\n                    if entry.path == prefix {\n                        paths.insert(String::new());\n                    } else if let Some(relative) = entry.path.strip_prefix(&format!(\"{prefix}/\")) {\n                        paths.insert(relative.to_string());\n                    }\n                } else {\n                    paths.insert(entry.path);\n                }\n            }\n        }\n        if paths.is_empty() && opts.paths.is_some() {\n            bail!(\"path is not in either snapshot\");\n        }\n        let mut output = vec![];\n        let mut changed = false;\n        for relative in paths {\n            let path = |prefix: &str| {\n                if relative.is_empty() {\n                    prefix.to_string()\n                } else {\n                    format!(\"{prefix}/{relative}\")\n                }\n            };\n            let (left_path, right_path) = opts.paths.as_ref().map_or_else(\n                || (relative.clone(), relative.clone()),\n                |(left, right)| (path(left), path(right)),\n            );\n            let left = self.restored_object_at(a, &left_path)?;\n            let right = self.restored_object_at(b, &right_path)?;\n            if left == right {","sourceCodeStart":1184,"sourceCodeEnd":1220,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/shadow.rs#L1184-L1220","documentation":"In the path-filtered diff flow, when the user supplied explicit paths (`opts.paths`) but the diff computation found no matching entries in either snapshot, this bail fires. Unlike error 945 it carries no path names, because filtering happened across a set of candidate paths that all came up empty.","triggerScenarios":"A history diff invoked with one or more `--path` filters where none of the given paths match any file in either snapshot (all candidate sets empty), at shadow.rs:1202 in the paths-collection loop.","commonSituations":"All supplied paths misspelled or formatted wrong (absolute OS paths vs root-relative tracked paths), paths that were never tracked, or both snapshots predate the files entirely.","solutions":["Verify each path against the snapshot listing and use root-relative tracked paths (e.g. `home/.gitconfig`).","Diff without path filters first to see which paths exist in the two snapshots.","Pick snapshots that actually contain the files (check timestamps of checkpoints).","Fix glob/path syntax if using patterns — overly narrow globs can match nothing."],"exampleFix":"// before\nmise history diff a b --path /Users/alice/.config/mise/config.toml\n// after\nmise history diff a b --path config/mise/config.toml","handlingStrategy":"validation","validationCode":"# ensure at least one filtered path is tracked before diffing\nfor p in \"home/.zshrc\" \"config/mise/config.toml\"; do\n  mise history show <snapshot> --list | grep -F \"$p\" && break\ndone","typeGuard":null,"tryCatchPattern":"// Rust\nmatch diff_paths(a, b, &paths) {\n    Ok(d) => show(d),\n    Err(e) if e.to_string().contains(\"path is not in either snapshot\") => {\n        eprintln!(\"none of the given paths are tracked in these snapshots\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Run an unfiltered diff first to discover valid tracked paths.","Use root-relative path forms consistently.","Check glob patterns actually match something before filtering."],"tags":["git","diff","history"],"backgroundTag":"empty-result-set","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"}