{"record":{"id":"ad902b58542ba527","repo":"zed-industries/zed","slug":"git-show-failed-with-error","errorCode":null,"errorMessage":"'git show' failed with error {:?}","messagePattern":"'git show' failed with error (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/git/src/commit.rs","lineNumber":145,"sourceCode":"        };\n        result.entry(sha).or_default().push(tag_name.to_string());\n    }\n\n    result.retain(|sha, _| shas.contains(sha));\n    result\n}\n\nasync fn get_messages_impl(git: &GitBinary, shas: &[Oid]) -> Result<Vec<String>> {\n    const MARKER: &str = \"<MARKER>\";\n    let output = git\n        .build_command(&[\"show\"])\n        .arg(\"-s\")\n        .arg(format!(\"--format=%B{}\", MARKER))\n        .args(shas.iter().map(ToString::to_string))\n        .output()\n        .await\n        .context(\"starting git show process\")?;\n    anyhow::ensure!(\n        output.status.success(),\n        \"'git show' failed with error {:?}\",\n        String::from_utf8_lossy(&output.stderr)\n    );\n    Ok(String::from_utf8_lossy(&output.stdout)\n        .trim()\n        .split_terminator(MARKER)\n        .map(|str| str.trim().replace(\"<\", \"&lt;\").replace(\">\", \"&gt;\"))\n        .collect::<Vec<_>>())\n}\n\npub(crate) const GITLINK_MODE: &str = \"160000\";\n\n#[derive(Clone, Copy, Debug, PartialEq, Eq)]\npub(crate) enum CommitDiffObjectKind {\n    Blob,\n    Gitlink,\n}","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/git/src/commit.rs#L127-L163","documentation":"The 'git show -s --format=%B<MARKER> <shas>' subprocess used to fetch commit messages exited non-zero ({error} is the process Output). Typically one of the requested SHAs does not exist in the repository (bad object), or the repo is corrupt; the ensure! guard fails the whole get_messages batch.","triggerScenarios":"Thrown at crates/git/src/commit.rs:145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify all requested SHAs exist ('git cat-file -e <sha>') before batching them into one git show call","Surface the captured stderr — 'bad object' names the offending SHA","Split the batch and retry per-sha to isolate which commit is unreadable"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}