{"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":"validation","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/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/resolve.rs#L146-L182","documentation":"Resolution failure in parse_commit_id: the given identifier matched no commit in the IdMap (neither a CLI ID nor a partial SHA). The message directs the user to 'but status' to see the identifiers that are currently available.","triggerScenarios":"`but resolve <commit-id>` / `but resolve --ai <commit-id>` with an ID that is not in the IdMap (unknown, truncated beyond recognition, or already gone).","commonSituations":"Typo in commit ID; commit was rebased away; referencing a branch or file when a commit is expected; stale terminal output from an older workspace state.","solutions":["Run `but status` and copy a valid commit ID from the output","Re-check spelling/completeness of the ID","Re-run after refreshing workspace state if the commit was recently created"],"exampleFix":"// before\nbut resolve abc123            # unknown id\n// after\nbut status                    # find valid commit ids\nbut resolve <id-from-status>","handlingStrategy":"validation","validationCode":"let ids = status_commit_ids(ctx); // from 'but status'\nif !ids.iter().any(|id| id.starts_with(user_id)) {\n    eprintln!(\"{user_id} not found; pick from but status\");\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = parse_commit_id(ctx, input) {\n    if e.to_string().contains(\"not found\") {\n        eprintln!(\"Run 'but status' to list valid commit ids\");\n    }\n}","preventionTips":["Copy commit IDs directly from `but status` output","Refresh workspace state before resolving after rebases","Validate IDs in scripts against status output first"],"tags":["cli","commit","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}