{"record":{"id":"5fe147350b925be0","repo":"gitbutlerapp/gitbutler","slug":"commit-commit-id-str-not-found","errorCode":null,"errorMessage":"Commit '{commit_id_str}' not found","messagePattern":"Commit '(.+?)' not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/show.rs","lineNumber":60,"sourceCode":"            let head_name = branch.name.clone();\n            if head_name == commit_id_str\n                || head_name.to_lowercase() == commit_id_str.to_lowercase()\n            {\n                // Found the branch in a stack\n                return show_branch(ctx, out, &head_name, verbose, &id_map);\n            }\n        }\n    }\n\n    // Not a branch, resolve the commit ID through the IdMap\n    let cli_ids = id_map.parse_using_context(commit_id_str, ctx)?;\n\n    let commit_id = if cli_ids.is_empty() {\n        // If not found in IdMap, try to parse as a git commit ID directly\n        let repo = ctx.repo.get()?;\n        let obj = repo\n            .rev_parse_single(commit_id_str)\n            .map_err(|_| anyhow::anyhow!(\"Commit '{commit_id_str}' not found\"))?;\n        let commit = obj\n            .object()?\n            .try_into_commit()\n            .map_err(|_| anyhow::anyhow!(\"'{commit_id_str}' is not a commit\"))?;\n        commit.id\n    } else if cli_ids.len() > 1 {\n        bail!(\n            \"Commit ID '{}' is ambiguous. Found {} matches\",\n            commit_id_str,\n            cli_ids.len()\n        );\n    } else {\n        match &cli_ids[0] {\n            CliId::Commit {\n                commit: CommitId { commit_id, .. },\n                id: _,\n            } => *commit_id,\n            CliId::Branch(branch) => {","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/show.rs#L42-L78","documentation":"`show_commit` resolves a user-supplied CLI id: when no matches exist in the IdMap it falls back to `rev_parse_single` on the git object database. This error is returned when git's rev-parse cannot resolve the given string to any object, meaning the commit id (or other CLI id) does not exist in the repository.","triggerScenarios":"Calling `but show <id>` where `<id>` is not in the IdMap and is not a resolvable git revision: a deleted/garbage-collected commit, a truncated or mistyped hash, an id from another repository/branch, or a stale CliId copied earlier.","commonSituations":"Copying a commit id from another checkout, referencing a commit that was rebased/squashed away, typos in a short hash, or using a CLI id after a workspace rebase invalidated it.","solutions":["re-run `but status` and use a current CLI id from the output","verify the id resolves with `git rev-parse <id>` in the same repository","check you are in the same repository the id came from"],"exampleFix":"// before\nbut show abc123d   # id from an old session\n// after\nbut status          # refresh CLI ids\nbut show <fresh-id>","handlingStrategy":"validation","validationCode":"if !id_map_contains(id) && Command::new(\"git\").args([\"rev-parse\",\"--verify\",id]).output().map(|o| !o.status.success()).unwrap_or(true) {\n    eprintln!(\"id {id} does not resolve; refresh with `but status`\");\n}","typeGuard":null,"tryCatchPattern":"match show_commit(ctx, id) {\n    Err(e) if e.to_string().contains(\"not found\") => {\n        eprintln!(\"Stale or unknown id '{id}'; re-run `but status`.\");\n    }\n    other => other?,\n}","preventionTips":["refresh CLI ids with `but status` after any workspace mutation","copy ids directly from `but status` output rather than memory","verify foreign ids with `git rev-parse` before use"],"tags":["git","cli","not-found"],"backgroundTag":"record-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"}