{"record":{"id":"9c23a30fe8048bcf","repo":"GitoxideLabs/gitoxide","slug":"the-resolved-conflict-is-outside-the-rebase-scope","errorCode":null,"errorMessage":"the resolved conflict is outside the rebase scope","messagePattern":"the resolved conflict is outside the rebase scope","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/todo.rs","lineNumber":821,"sourceCode":"    }\n    for tip in &state.tips {\n        repo.find_commit(*tip).context(\"could not find a recorded rebase tip\")?;\n    }\n    for id in &state.scope {\n        let commit = repo\n            .find_commit(*id)\n            .context(\"could not find a recorded scope commit\")?;\n        let parent = commit\n            .parent_ids()\n            .next()\n            .map(gix::Id::detach)\n            .context(\"a recorded scope commit has no parent\")?;\n        if parent != state.base && !scope.contains(&parent) && !continuation_sources.contains(id) {\n            anyhow::bail!(\"a recorded scope commit is disconnected from the rebase base\");\n        }\n    }\n    if state.resolved.is_some_and(|id| !scope.contains(&id)) {\n        anyhow::bail!(\"the resolved conflict is outside the rebase scope\");\n    }\n    if !continuation_sources.is_subset(&scope) {\n        anyhow::bail!(\"a continuation source is outside the rebase scope\");\n    }\n    Ok(())\n}\n\npub(crate) fn parse(repo: &gix::Repository, edited: &[u8]) -> Result<Option<Parsed>> {\n    repo.head()?.id().context(\"rebase todos require a born HEAD\")?;\n    let input = std::str::from_utf8(edited).context(\"the rebase todo is not UTF-8\")?;\n    let Some(mut state) = parse_state(repo, input)? else {\n        return Ok(None);\n    };\n    let scope: HashSet<_> = state.scope.iter().copied().collect();\n    let mut picked = HashMap::<ObjectId, usize>::new();\n    let mut steps = Vec::<rebase::PlanStep>::new();\n    let mut cursor = None;\n    let mut checkout_target = None;","sourceCodeStart":803,"sourceCodeEnd":839,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/todo.rs#L803-L839","documentation":"If the state records a resolved conflict commit (`resolved`), that commit must be inside the captured rebase scope. A resolved commit outside the scope means the recorded conflict resolution cannot belong to this rebase, so the state is rejected as inconsistent.","triggerScenarios":"validate_state checks `state.resolved.is_some_and(|id| !scope.contains(&id))`; the bail fires when the `resolved` field of the persisted state holds an ObjectId not present in `state.scope`. Caused by hand-edited state, stale state after external history rewrites, or cross-repo state copies.","commonSituations":"Resuming an interrupted rebase after a reset/rebase/GC changed commit IDs; manually fixing conflict resolution in the state file.","solutions":["Discard the rebase state and restart the rebase to recapture the resolved commit","Update the `resolved` field to the in-scope ObjectId of the actual resolution","Avoid running other history-rewriting git commands while a tix rebase is in progress"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if let Some(resolved) = state.resolved {\n    assert!(scope.contains(&resolved), \"resolved commit must be in scope\");\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = result {\n    if e.to_string().contains(\"resolved conflict is outside the rebase scope\") {\n        // abandon state and restart the rebase\n    }\n}","preventionTips":["Resolve conflicts through the tix workflow, not by editing state","Avoid reset/GC between interruption and resumption","Validate state before each resume"],"tags":["rebase","state-validation","conflict-resolution"],"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-16T04:17:20.429Z"}