{"record":{"id":"4f6e82acd7145577","repo":"GitoxideLabs/gitoxide","slug":"the-parent-of-a-repeated-rebase-must-not-be-pendin","errorCode":null,"errorMessage":"the parent of a repeated rebase must not be pending","messagePattern":"the parent of a repeated rebase must not be pending","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/rebase.rs","lineNumber":2561,"sourceCode":") -> Result<()> {\n    for (position, id) in affected.iter().enumerate() {\n        let parents = graph.parents_of(*id).context(\"an affected commit is incomplete\")?;\n        if parents.len() > 1 && (position > 0 || removed || tree == Tree::CherryPick) {\n            anyhow::bail!(\"descendant merge commits cannot be rebased\");\n        }\n        if repeat && position == 0 {\n            let commit = repo.find_commit(*id)?.decode()?.into_owned()?;\n            if !is_pending(&commit) {\n                anyhow::bail!(\"the root of a repeated rebase must be pending\");\n            }\n        }\n    }\n    if repeat\n        && let Some(base) = affected.first()\n        && let Some(parent) = graph.parents_of(*base).and_then(|parents| parents.first().copied())\n        && is_pending(&repo.find_commit(parent)?.decode()?.into_owned()?)\n    {\n        anyhow::bail!(\"the parent of a repeated rebase must not be pending\");\n    }\n    Ok(())\n}\n\nfn reject_pending_checkout_path(repo: &gix::Repository, mut id: ObjectId) -> Result<()> {\n    let mut seen = HashSet::new();\n    while seen.insert(id) {\n        let commit = repo.find_commit(id)?.decode()?.into_owned()?;\n        if is_pending(&commit) {\n            anyhow::bail!(\"the current checkout has a pending rebase; time-travel to HEAD before editing it\");\n        }\n        let Some(parent) = commit.parents.first().copied() else {\n            break;\n        };\n        id = parent;\n    }\n    Ok(())\n}","sourceCodeStart":2543,"sourceCodeEnd":2579,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/rebase.rs#L2543-L2579","documentation":"During rebase edit validation, when `repeat` is set, the parent of the first affected commit (`affected.first()`) must NOT itself be pending. If the parent commit is part of an unfinished rebase, rebasing a descendant on top of it would corrupt the in-progress rebase ordering, so the edit bails with this message.","triggerScenarios":"Calling a repeated rebase edit where `graph.parents_of(*base)` yields a first parent whose decoded commit satisfies `is_pending()`. I.e. the base of the repeated rebase hangs directly under another pending commit.","commonSituations":"Chaining repeated rebase edits across overlapping ranges; editing a range whose base commit was itself just rewritten but left pending; rebase scripts that operate on adjacent segments of the same pending stack in the wrong order.","solutions":["Rebase the pending parent commit first (or complete it) before repeating a rebase whose base hangs under it.","Choose a base whose parent is not pending — start the repeated range higher or lower in the history.","Reorder the edit operations so the rebase proceeds root-to-tip and never attaches to a pending parent.","Abort the pending rebase involving the parent, then retry the edit."],"exampleFix":"// before: base parent is still pending\nlet parent = graph.parents_of(base).unwrap()[0];\nassert!(!is_pending(&repo.find_commit(parent)?.decode()?)); // fails\nedit.rebase(base, true, ...)?;\n// after: resolve the pending parent first\nfinish_or_abort_pending(parent)?;\nlet parent = graph.parents_of(base).unwrap()[0];\nedit.rebase(base, true, ...)?;","handlingStrategy":"validation","validationCode":"let base = *affected.first().context(\"empty range\")?;\nif let Some(parent) = graph.parents_of(base).and_then(|p| p.first().copied()) {\n    let c = repo.find_commit(parent)?.decode()?.into_owned()?;\n    debug_assert!(!gix_tix::edit::rebase::is_pending(&c));\n}\n","typeGuard":"fn parent_is_settled(repo: &gix::Repository, graph: &Graph, base: ObjectId) -> anyhow::Result<bool> {\n    Ok(graph.parents_of(base)\n        .and_then(|p| p.first().copied())\n        .map(|parent| !gix_tix::edit::rebase::is_pending(&repo.find_commit(parent)?.decode()?.into_owned()?))\n        .unwrap_or(true))\n}\n","tryCatchPattern":null,"preventionTips":["Process repeated rebase ranges root-to-tip so parents are settled before descendants","Re-check pending state of neighboring commits before each edit","Avoid overlapping repeated ranges in one script run"],"tags":["rebase","git","state-validation"],"backgroundTag":"invalid-state-transition","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"}