{"record":{"id":"68377aaae4e2b6b8","repo":"gitbutlerapp/gitbutler","slug":"the-prefix-is-unambiguous","errorCode":null,"errorMessage":"the prefix is unambiguous","messagePattern":"the prefix is unambiguous","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-debug/src/command/graph.rs","lineNumber":69,"sourceCode":"        .transpose()?\n        .map(|id| id.detach());\n    let opts = but_graph::init::Options {\n        extra_target_commit_id: extra_target,\n        collect_tags: true,\n        hard_limit: graph_args.hard_limit,\n        commits_limit_hint: graph_args.limit.flatten(),\n        commits_limit_recharge_location: graph_args\n            .limit_extension\n            .iter()\n            .map(|short_hash| {\n                repo.objects\n                    .lookup_prefix(\n                        gix::hash::Prefix::from_hex(short_hash).expect(\"valid hex prefix\"),\n                        None,\n                    )\n                    .unwrap()\n                    .expect(\"object for prefix exists\")\n                    .expect(\"the prefix is unambiguous\")\n            })\n            .collect(),\n        dangerously_skip_postprocessing_for_debugging: graph_args.no_post,\n        worktrees: false,\n    };\n\n    let graph = match graph_args.ref_name.as_deref() {\n        None => but_graph::Graph::from_head(\n            &repo,\n            &meta,\n            but_core::ref_metadata::ProjectMeta::default(),\n            &mut setup::debug_db()?,\n            opts,\n        ),\n        Some(ref_name) => {\n            let mut reference = repo.find_reference(ref_name)?;\n            let id = reference.peel_to_id()?;\n            but_graph::Graph::from_commit_traversal(","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-debug/src/command/graph.rs#L51-L87","documentation":"A panic (expect) in but-debug's graph command: lookup_prefix() found multiple objects matching the --limit-extension hex prefix (it returns a Candidates mode), and the debug path asserts exactly one. Standard git abbreviated-hash ambiguity, turned into a hard abort.","triggerScenarios":"Passing a short --limit-extension prefix (e.g. 4-6 hex chars) that is shared by two or more objects in this repository; larger repositories make short prefixes collide more often.","commonSituations":"Using copied short hashes after the repo gained new objects that collide; scripts that cut hashes to a fixed short length; repositories with many tags/blobs sharing early nibbles.","solutions":["Lengthen the prefix until it is unique — `git rev-parse <prefix>` tells you when it is still ambiguous.","Or pass the full 40/64-char hash.","Update scripts that truncate hashes to instead use git's own disambiguation output."],"exampleFix":"# before\nbut debug graph --limit-extension 4c1f  # ambiguous in this repo\n\n# after\nbut debug graph --limit-extension $(git rev-parse --short=12 <ref>)","handlingStrategy":"validation","validationCode":"# let git pick a unambiguous short hash\nEXT=$(git rev-parse --short=12 \"$REF\") # errors out itself if still ambiguous\nbut debug graph --limit-extension \"$EXT\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer full hashes or >=12-char prefixes in scripts.","After fetches grow the object store, re-derive short hashes instead of caching them."],"tags":["rust","cli","debug-tooling","panic","hash-prefix"],"backgroundTag":"ambiguous-hash-prefix","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}