{"record":{"id":"73ec6bd0d1369d1f","repo":"GitoxideLabs/gitoxide","slug":"could-not-decode-commit-graph-parent-err","errorCode":null,"errorMessage":"could not decode commit-graph parent: {err}","messagePattern":"could not decode commit-graph parent: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/history.rs","lineNumber":404,"sourceCode":"                for token in iter {\n                    match token.context(\"could not decode cached history commit\")? {\n                        Token::Tree { .. } => {}\n                        Token::Parent { id } => parents.push(id),\n                        Token::Committer { signature } => {\n                            commit_time = signature.seconds();\n                            break;\n                        }\n                        _ => {}\n                    }\n                }\n                (parents, commit_time, None)\n            }\n            gix::traverse::commit::Either::CachedCommit(commit) => {\n                let cache = cache.expect(\"cached commits originate from the provided commit-graph\");\n                let mut parents = gix::traverse::commit::ParentIds::new();\n                for parent in commit.iter_parents() {\n                    let parent =\n                        parent.map_err(|err| anyhow::anyhow!(\"could not decode commit-graph parent: {err}\"))?;\n                    parents.push(cache.id_at(parent).to_owned());\n                }\n                (\n                    parents,\n                    commit.committer_timestamp() as gix::date::SecondsSinceUnixEpoch,\n                    Some(commit.generation()),\n                )\n            }\n        };\n        if shallow.contains(&id) {\n            parents.clear();\n        }\n        let parents: Vec<_> = parents\n            .into_iter()\n            .map(|parent| self.intern(parent))\n            .collect::<Result<_>>()?;\n        let start: u32 = self\n            .parents","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/history.rs#L386-L422","documentation":"When building history from cached commits, tix reads each commit's parents from the commit-graph. If decoding a parent entry from the commit-graph fails (corrupt or truncated graph file, hash mismatch, unsupported format), the error is wrapped with this message and propagated to callers like `for_commits`, `schedule_cached`, and `load`.","triggerScenarios":"Calling history loading/scheduling APIs (`for_commits`, `schedule_cached`, `load`) while the repository's commit-graph file is corrupt, truncated, or contains a parent position that cannot be decoded for the traversed commit.","commonSituations":"A crash or disk-full event corrupted `.git/objects/info/commit-graph`, an interrupted `git commit-graph write`, a version mismatch between the graph file and the object hash, or a repository copied incompletely.","solutions":["Delete the commit-graph file(s) (`.git/objects/info/commit-graph` and the commit-graphs directory) and regenerate with `git commit-graph write` or `gix` equivalent","Run `git fsck` to detect broader object-store corruption and restore from a clone/backup if needed","Re-clone or restore the repository from a known-good source if the graph and objects are both damaged","Verify the repository's object hash matches the commit-graph format in use"],"exampleFix":"// recovery (shell)\nrm -rf .git/objects/info/commit-graph .git/objects/info/commit-graphs\ngit commit-graph write --reachable","handlingStrategy":"fallback","validationCode":"// check commit-graph health before cached traversal\nif std::path::Path::new(\".git/objects/info/commit-graph\").exists() {\n    let ok = std::process::Command::new(\"git\")\n        .args([\"commit-graph\", \"verify\"])\n        .status()\n        .map(|s| s.success())\n        .unwrap_or(false);\n    if !ok {\n        eprintln!(\"commit-graph corrupt; regenerating\");\n        let _ = std::fs::remove_file(\".git/objects/info/commit-graph\");\n    }\n}","typeGuard":"fn commit_graph_is_valid(repo_path: &std::path::Path) -> bool {\n    std::process::Command::new(\"git\")\n        .args([\"-C\"])\n        .arg(repo_path)\n        .args([\"commit-graph\", \"verify\"])\n        .status()\n        .map(|s| s.success())\n        .unwrap_or(false)\n}","tryCatchPattern":"match load_history(&repo) {\n    Ok(h) => h,\n    Err(e) if e.to_string().contains(\"commit-graph parent\") => {\n        eprintln!(\"commit-graph unreadable; falling back to object walk\");\n        remove_commit_graph(&repo)?;\n        load_history(&repo)?\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Run `git commit-graph verify` after crashes or disk-full events","Avoid interrupting `git commit-graph write`","Regenerate the commit-graph after copying repositories","Monitor `git fsck` output for object-store damage"],"tags":["git","commit-graph","corruption","traversal"],"backgroundTag":"file-read-failed","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}