{"record":{"id":"4640a04ff61be2dd","repo":"GitoxideLabs/gitoxide","slug":"the-rebase-state-has-more-than-one-base","errorCode":null,"errorMessage":"the rebase state has more than one base","messagePattern":"the rebase state has more than one base","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/todo.rs","lineNumber":685,"sourceCode":"        anyhow::bail!(\"the rebase todo contains more than one state anchor\");\n    }\n    let mut base = None;\n    let mut onto = None;\n    let mut tips = Vec::new();\n    let mut scope = Vec::new();\n    let mut marker_required = None;\n    let mut checkout_allowed = None;\n    let mut head_ref = None;\n    let mut edit_refs = false;\n    let mut expected_refs = Vec::new();\n    let mut resolved = None;\n    let mut continuation_sources = Vec::new();\n    for line in body[..end].lines() {\n        let (key, value) = line.split_once(' ').context(\"a rebase state line has no value\")?;\n        match key {\n            \"base\" => {\n                if base.replace(ObjectId::from_hex(value.as_bytes())?).is_some() {\n                    anyhow::bail!(\"the rebase state has more than one base\");\n                }\n            }\n            \"onto\" => {\n                if onto.replace(ObjectId::from_hex(value.as_bytes())?).is_some() {\n                    anyhow::bail!(\"the rebase state has more than one onto target\");\n                }\n            }\n            \"tip\" => tips.push(ObjectId::from_hex(value.as_bytes())?),\n            \"scope\" => scope.push(ObjectId::from_hex(value.as_bytes())?),\n            \"marker-required\" => {\n                if marker_required.replace(value.parse()?).is_some() {\n                    anyhow::bail!(\"the rebase state repeats marker-required\");\n                }\n            }\n            \"checkout-allowed\" => {\n                if checkout_allowed.replace(value.parse()?).is_some() {\n                    anyhow::bail!(\"the rebase state repeats checkout-allowed\");\n                }","sourceCodeStart":667,"sourceCodeEnd":703,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/todo.rs#L667-L703","documentation":"The state anchor body is a key/value list where `base` may appear at most once. If a second `base` line is found, `parse_state` bails because the rebase's base commit would be ambiguous — the parser refuses to guess which one is authoritative.","triggerScenarios":"Calling `parse` on a todo whose state anchor contains two `base <oid>` lines — typically from a duplicated or hand-edited state block.","commonSituations":"Manual editing of the state anchor adding a stray base line; a bad merge/patch duplicating state lines inside one anchor; scripted todo generation emitting base twice.","solutions":["Remove the duplicate `base` line from the state anchor, keeping the correct oid.","Regenerate the todo/state anchor with tix instead of editing it by hand.","Abort and restart the rebase to get a pristine state block.","Validate the anchor content with `grep -c '^base '` before parsing."],"exampleFix":"// before (inside anchor body)\n// base 0123abc...\n// base 4567def...\nlet state = parse_state(repo, text)?; // bails\n\n// after\n// base 0123abc...   (single, correct base)\nlet state = parse_state(repo, &dedupe_state_lines(text))?;","handlingStrategy":"validation","validationCode":"// inside the anchor body, before parsing\nlet base_lines = body.lines().filter(|l| l.starts_with(\"base \")).count();\nif base_lines > 1 {\n    anyhow::bail!(\"state anchor declares base more than once\");\n}","typeGuard":null,"tryCatchPattern":"match parse(repo, todo_text) {\n    Ok(s) => s,\n    Err(e) if e.to_string().contains(\"more than one base\") => {\n        // fix the anchor to a single base line, then retry\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Avoid hand-editing state anchors; regenerate via tix","Check duplicated lines after applying patches to todo files","Lint anchor bodies: each of base/onto must appear exactly once"],"tags":["parsing","rebase","malformed-input","duplication"],"backgroundTag":"schema-validation-failed","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"}