{"record":{"id":"a970d93d96c87f1d","repo":"GitoxideLabs/gitoxide","slug":"unsupported-undo-metadata-version","errorCode":null,"errorMessage":"unsupported undo metadata version","messagePattern":"unsupported undo metadata version","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/undo.rs","lineNumber":604,"sourceCode":"        State::Object(id) => format!(\"object:{id}\").into(),\n        State::Symbolic(name) => {\n            let mut value = BString::from(\"symbolic:\");\n            value.extend_from_slice(name.as_bstr());\n            value\n        }\n    }\n}\n\nfn parse_config(repo: &gix::Repository, body: &BStr) -> Result<Vec<RefChange>> {\n    let config = File::try_from(body).context(\"could not parse undo metadata as Git config\")?;\n    let mut sections = config.sections();\n    let undo = sections.next().context(\"undo metadata has no version section\")?;\n    ensure!(\n        undo.header().name() == b\"undo\" && undo.header().subsection_name().is_none(),\n        \"undo metadata must start with [undo]\"\n    );\n    ensure_exact_keys(&undo, &[\"version\"])?;\n    ensure!(\n        undo.value(\"version\").as_ref().map(|value| value.as_slice()) == Some(VERSION.as_bytes()),\n        \"unsupported undo metadata version\"\n    );\n\n    let mut changes = Vec::new();\n    let mut previous_name: Option<FullName> = None;\n    for section in sections {\n        ensure!(\n            section.header().name() == b\"ref\",\n            \"undo metadata contains an unknown section\"\n        );\n        let subsection = section\n            .header()\n            .subsection_name()\n            .context(\"an undo ref section has no reference name\")?;\n        let name = FullName::try_from(subsection).context(\"an undo entry contains an invalid reference name\")?;\n        ensure!(!is_queue_ref(name.as_bstr()), \"the undo queue records itself\");\n        if let Some(previous) = &previous_name {","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/undo.rs#L586-L622","documentation":"The `[undo]` section of a queue commit's config carries a `version` key. `parse_config` accepts only the exact `VERSION` string this build understands; any other value means the metadata was written by a different (older or newer) version of the tool whose semantics it cannot safely interpret, so it refuses with this error.","triggerScenarios":"`parse_commit` -> `parse_config` when the queue commit's `[undo] version` key differs from the library's `VERSION` constant — e.g. the queue was written by a newer/older gix-tix build.","commonSituations":"Downgrading the tool after using a newer queue format; moving a repository between machines with different gix-tix versions; hand-editing the version value.","solutions":["Upgrade (or downgrade) gix-tix to the version matching the queue's `version` value and retry undo/redo.","Inspect the queue commit (`git cat-file -p <tip>`) to confirm the recorded version before switching builds.","As a last resort, discard the undo queue (delete/reset the queue refs) and re-record history — losing undo capability for prior edits."],"exampleFix":"// before: queue written by version 2, running binary with VERSION = \"1\"\n[undo]\n\tversion = 2\n// after: run the matching tool version, or start a fresh queue\n[undo]\n\tversion = 1","handlingStrategy":"try-catch","validationCode":"// read the queue's version key and compare against the library VERSION before undo/redo\nlet body = extract_config_body(&queue_commit);\nlet file = gix::config::File::try_from(body)?;\nlet ver = file.raw_value(\"undo.version\");\nif ver.map(|v| v != VERSION.as_bytes()).unwrap_or(true) {\n    anyhow::bail!(\"queue version does not match tool version {} — switch builds\", VERSION);\n}","typeGuard":null,"tryCatchPattern":"match repo.undo() {\n    Ok(()) => {},\n    Err(e) if e.to_string().contains(\"unsupported undo metadata version\") => {\n        eprintln!(\"switch to the gix-tix build matching the queue version\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Pin gix-tix versions across machines sharing a repository.","Check the queue's version key after tool upgrades before undoing.","Don't hand-edit the `version` value in queue metadata."],"tags":["git","undo-queue","versioning","metadata"],"backgroundTag":"unsupported-config-value","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"}