{"record":{"id":"2771109f27e0ae54","repo":"gitbutlerapp/gitbutler","slug":"commit-commit-id-str-not-found-try-running-b","errorCode":null,"errorMessage":"Commit '{commit_id_str}' not found. Try running 'but status' to see available commits.","messagePattern":"Commit '(.+?)' not found\\. Try running 'but status' to see available commits\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/resolve.rs","lineNumber":164,"sourceCode":"                t.success.paint(\"✓ Marked as resolved:\"),\n                t.attention.paint(path)\n            )?;\n        }\n    }\n    Ok(())\n}\n\n/// Resolve a user-provided commit identifier (CLI ID or partial SHA) to an\n/// object id, along with its display ref rendered from the same map.\nfn parse_commit_id(ctx: &mut Context, commit_id_str: &str) -> Result<(gix::ObjectId, String)> {\n    // Create an IdMap to resolve commit IDs (supports both CLI IDs and partial SHAs)\n    let id_map = IdMap::legacy_new_from_context(ctx)?;\n\n    // Resolve the commit ID using the IdMap\n    let matches = id_map.parse_using_context(commit_id_str, ctx)?;\n\n    if matches.is_empty() {\n        bail!(\n            \"Commit '{commit_id_str}' not found. Try running 'but status' to see available commits.\"\n        );\n    }\n\n    if matches.len() > 1 {\n        bail!(\n            \"Commit ID '{commit_id_str}' is ambiguous. Please provide more characters to uniquely identify the commit.\"\n        );\n    }\n\n    // Extract the commit OID from the matched CliId\n    match &matches[0] {\n        CliId::Commit {\n            commit: CommitId { commit_id, .. },\n            id: _,\n        } => {\n            let commit_ref = theme::Commit(CommitIdRef {\n                commit_id: *commit_id,","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/legacy/resolve.rs#L146-L182","documentation":"`but resolve <commit-id>` resolves the ID through the legacy IdMap, which supports both CLI IDs and partial SHAs (resolve.rs:162-167). Zero matches means the ID is unknown in this workspace — typo, stale short ID, or wrong project — and the message points you at `but status` to list available commits.","triggerScenarios":"`but resolve <id>` where `parse_using_context` returns an empty vec: partial SHA too short or wrong, ID copied from another workspace/clone, or the commit removed by a rebase/squash since the ID was copied.","commonSituations":"Partial SHAs that were unique in a different clone; IDs invalidated when history was rewritten; simple typos in short IDs.","solutions":["Run `but status` and copy a current commit ID.","Lengthen the partial SHA or use the CLI ID printed by status.","Confirm you are in the same workspace/project the ID came from."],"exampleFix":"# before\nbut resolve 4z1   # no matches -> Commit '4z1' not found\n\n# after\nbut status        # copy a valid commit ID\nbut resolve 5c","handlingStrategy":"validation","validationCode":"but status | grep -F '<id>' || { echo 'unknown commit id'; exit 2; }\nbut resolve '<id>'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Refresh IDs from `but status` after any history-rewriting operation.","Prefer CLI IDs over raw partial SHAs — they are validated against the current workspace."],"tags":["cli","resolve","id-resolution","gitbutler"],"backgroundTag":"entity-not-found-by-id","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}