{"record":{"id":"b0d1bef135929c2a","repo":"GitoxideLabs/gitoxide","slug":"a-continuation-source-is-outside-the-rebase-scope","errorCode":null,"errorMessage":"a continuation source is outside the rebase scope","messagePattern":"a continuation source is outside the rebase scope","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/todo.rs","lineNumber":824,"sourceCode":"    }\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;\n    let mut explicit_checkout_reference = None;\n    let mut command_marker = false;\n    let mut ref_targets = HashMap::new();","sourceCodeStart":806,"sourceCodeEnd":842,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/todo.rs#L806-L842","documentation":"Continuation sources are commits where an interrupted rebase may resume; they must all belong to the captured rebase scope. If any continuation-source commit is outside the scope, the state cannot be trusted to resume safely and is rejected.","triggerScenarios":"validate_state's final check `!continuation_sources.is_subset(&scope)` fires when the `continuation-source` entries parsed from the state file include ObjectIds absent from `state.scope`. Caused by hand-edited state, truncated writes, or stale state after history changed under it.","commonSituations":"Editing the state file to add resume points; resuming a rebase after another git operation rewrote commit IDs; copying rebase state across repositories.","solutions":["Delete the stale rebase state and restart the rebase","Correct the continuation-source entries so they reference in-scope commits","Ensure the rebase is started and resumed with the same tix version and repository state"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let sources: HashSet<_> = state.continuation_sources.iter().copied().collect();\nlet scope: HashSet<_> = state.scope.iter().copied().collect();\nassert!(sources.is_subset(&scope), \"all continuation sources must be in scope\");","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"continuation source is outside the rebase scope\") => {\n        // state is inconsistent: discard and restart\n    }\n    r => r?,\n}","preventionTips":["Let tix record continuation sources automatically","Do not append continuation-source entries by hand","Recreate state after any external history rewrite"],"tags":["rebase","state-validation","continuation"],"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"}