{"record":{"id":"3ce8702dbf41316d","repo":"jdx/mise","slug":"spec-matches-more-than-one-checkpoint-use-a-l","errorCode":null,"errorMessage":"{spec:?} matches more than one checkpoint; use a longer prefix","messagePattern":"(.+?) matches more than one checkpoint; use a longer prefix","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/store.rs","lineNumber":1019,"sourceCode":"        return entries\n            .iter()\n            .find(|entry| entry.id == id)\n            .map(|entry| entry.id)\n            .ok_or_else(|| eyre!(\"no history checkpoint matches {spec:?}\"));\n    } else {\n        spec\n    };\n    if prefix.is_empty() {\n        bail!(\"invalid checkpoint reference {spec:?}\");\n    }\n    let matches: Vec<&Entry> = entries\n        .iter()\n        .filter(|entry| entry.checkpoint.uuid.starts_with(prefix))\n        .collect();\n    match matches.as_slice() {\n        [one] => Ok(one.id),\n        [] => bail!(\"no history checkpoint matches {spec:?}\"),\n        _ => bail!(\"{spec:?} matches more than one checkpoint; use a longer prefix\"),\n    }\n}\n\npub(crate) fn now_rfc3339() -> String {\n    chrono::Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Millis, true)\n}\n\npub(crate) fn new_uuid() -> String {\n    uuid::Uuid::now_v7().to_string()\n}\n\npub(crate) fn write_json<T: Serialize>(path: &Path, value: &T) -> Result<()> {\n    let mut text = serde_json::to_string_pretty(value)?;\n    text.push('\\n');\n    if let Some(parent) = path.parent() {\n        file::create_dir_all(parent)?;\n    }\n    file::write_atomic(path, text).wrap_err_with(|| format!(\"writing {}\", display_path(path)))?;","sourceCodeStart":1001,"sourceCodeEnd":1037,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/store.rs#L1001-L1037","documentation":"Prefix matching for checkpoint references can be ambiguous: if the given prefix matches more than one checkpoint UUID, mise cannot know which entry you mean and refuses to guess. The message asks for a longer prefix to disambiguate. This is the standard short-hash ambiguity error applied to checkpoint ids.","triggerScenarios":"Supplying a short UUID prefix that is a prefix of two or more stored checkpoint UUIDs, e.g. `mise dotfiles show abc` when both `abc1...` and `abc9...` exist.","commonSituations":"Using a 1-3 character prefix from memory; large history where early characters collide; scripting with truncated ids.","solutions":["Repeat the command with a longer prefix until it is unique.","List checkpoints to copy the full UUID.","In scripts, always pass full ids captured from the list output instead of hand-shortened prefixes."],"exampleFix":"// before\nmise dotfiles show ab\nError: \"ab\" matches more than one checkpoint; use a longer prefix\n\n// after\nmise dotfiles show ab3f9c2e","handlingStrategy":"validation","validationCode":"let matching: Vec<_> = entries.iter().filter(|e| e.checkpoint.uuid.starts_with(prefix)).collect();\nif matching.len() > 1 {\n  eprintln!(\"prefix {prefix} is ambiguous ({} matches); use a longer prefix\", matching.len());\n}","typeGuard":"fn prefix_is_unique(prefix: &str, entries: &[Entry]) -> bool {\n  entries.iter().filter(|e| e.checkpoint.uuid.starts_with(prefix)).count() == 1\n}","tryCatchPattern":null,"preventionTips":["Use full UUIDs in scripts and aliases.","Grow prefixes until unique before running the command.","Prefer interactive/picker flows when history is large."],"tags":["history","checkpoint","ambiguous","cli"],"backgroundTag":"ambiguous-identifier","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"}