{"record":{"id":"1a500153582bce29","repo":"GitoxideLabs/gitoxide","slug":"the-rebase-todo-uses-an-unsupported-state-version","errorCode":null,"errorMessage":"the rebase todo uses an unsupported state version","messagePattern":"the rebase todo uses an unsupported state version","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/todo.rs","lineNumber":658,"sourceCode":"    }\n}\n\nfn short(repo: &gix::Repository, id: ObjectId, show_change_id: bool) -> Result<String> {\n    if show_change_id {\n        crate::change_id::display_short(repo, id).context(\"could not format a rebase todo ID\")\n    } else {\n        Ok(id\n            .attach(repo)\n            .shorten()\n            .context(\"could not shorten a rebase todo ID\")?\n            .to_string())\n    }\n}\n\nfn parse_state(repo: &gix::Repository, input: &str) -> Result<Option<State>> {\n    let Some(start) = input.find(STATE_START) else {\n        if input.contains(\"<!-- tix-rebase-state-\") {\n            anyhow::bail!(\"the rebase todo uses an unsupported state version\");\n        }\n        return Ok(None);\n    };\n    let body = &input[start + STATE_START.len()..];\n    let end = body\n        .find(STATE_CLOSE)\n        .context(\"the rebase state anchor is not closed\")?;\n    if body[end + STATE_CLOSE.len()..].contains(STATE_START) {\n        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;","sourceCodeStart":640,"sourceCodeEnd":676,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/todo.rs#L640-L676","documentation":"`parse_state` scans a rebase todo file for the tix state anchor `<!-- tix-rebase-state-<version> ... -->`. If the text contains a state marker of some version but not the exact `STATE_START` prefix this build understands, the todo was produced by a different (newer or older) tix version and parsing is refused rather than misinterpreted.","triggerScenarios":"Running `parse` on a todo file written by a tix version with a different state-anchor format version — the literal `<!-- tix-rebase-state-` appears but doesn't match the expected `STATE_START` constant (e.g. version bumped from v1 to v2).","commonSituations":"Upgrading or downgrading the tix binary while an in-progress rebase todo from another version is on disk; mixing tix versions between teammates or CI and a local checkout; a hand-edited todo that corrupted the version suffix.","solutions":["Use the same tix version that wrote the todo to finish or abort the rebase.","Abort the in-progress rebase and restart it with the current tix version.","Regenerate the state anchor by re-running the rebase preparation with the installed tix.","Check the anchor's version in the todo file and compare it with your tix build's supported version."],"exampleFix":"// before: todo contains \"<!-- tix-rebase-state-v9 ...\" but binary expects v2\nlet state = parse(repo, todo_text)?; // bails: unsupported state version\n\n// after: finish/abort with the matching tix version first\n// $ tix-<matching-version> rebase --abort\nlet state = parse(repo, fresh_todo_text)?;","handlingStrategy":"fallback","validationCode":"let supported = \"<!-- tix-rebase-state-v2 \"; // match STATE_START of your build\nif todo_text.contains(\"<!-- tix-rebase-state-\") && !todo_text.contains(supported) {\n    anyhow::bail!(\"todo written by a different tix version\");\n}","typeGuard":null,"tryCatchPattern":"match parse(repo, todo_text) {\n    Ok(s) => s,\n    Err(e) if e.to_string().contains(\"unsupported state version\") => {\n        // fall back to the matching tix binary or abort/restart the rebase\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Use one tix version across the team and CI","Finish or abort in-progress rebases before upgrading tix","Check the state anchor version string before changing binaries"],"tags":["versioning","parsing","rebase","compatibility"],"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-15T23:17:13.987Z"}