GitoxideLabs/gitoxide · error
unsupported rebase state field
Error message
unsupported rebase state field {key:?} What it means
Catch-all for unrecognized keys: `parse_state` matches known rebase-state field names and bails with `unsupported rebase state field {key:?}` for anything else. This rejects state files written by incompatible (newer or foreign) versions of the tool rather than silently ignoring unknown fields.
Solutions
- Check the binary's version against the version that wrote the state file; upgrade gix/gix-tix if the state was written by a newer release.
- Remove or correct the misspelled field name in the state file if it was hand-edited.
- Abort and regenerate the state file with the current tool version.
Example fix
// before (state file) marker_requird true // after marker-required true
Defensive patterns
Strategy: try-catch
Validate before calling
const KNOWN_KEYS: &[&str] = &["base","onto","tip","scope","marker-required","checkout-allowed","head-ref","edit-refs","ref","resolved","continuation-source"];
fn keys_are_known(text: &str) -> Vec<&str> {
text.lines()
.filter_map(|l| l.split_whitespace().next())
.filter(|k| !KNOWN_KEYS.contains(k))
.collect()
} Try / catch
match todo::parse(state_text) {
Ok(state) => apply(state),
Err(e) if e.to_string().starts_with("unsupported rebase state field") => {
eprintln!("state written by an incompatible version; upgrade the binary or regenerate state");
}
Err(e) => return Err(e),
} Prevention
- Keep the gix/gix-tix binary version in sync with whatever wrote the state.
- Pin tool versions in CI so state files are never produced by a newer release.
- Spell state keys exactly as the tool writes them; never invent keys.
When it happens
Trigger: `parse_state` (gix-tix/src/edit/todo.rs:754) encounters a `key value` line whose key is not one of base/onto/tip/scope/marker-required/checkout-allowed/head-ref/edit-refs/ref/resolved/continuation-source.
Common situations: State file written by a newer gix-tix version then read by an older binary; hand-edited lines with typos in key names; foreign tools writing their own state into the file.
Related errors
- the rebase state repeats marker-required
- the rebase state repeats checkout-allowed
- the recorded HEAD ref has trailing data
- the rebase state repeats its HEAD ref
- a captured ref name has trailing data
AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08).
Data as JSON: /api/errors/fdec282650b41552.
Report an issue: GitHub.
Appendix: source
Thrown at gix-tix/src/edit/todo.rs:754
}
let name = gix::refs::FullName::try_from(name.as_ref()).context("a captured ref name is invalid")?;
expected_refs.push(rebase::ExpectedRef {
name,
old,
target,
new: old,
follows_tip,
editable,
placement: None,
});
}
"resolved" => {
if resolved.replace(ObjectId::from_hex(value.as_bytes())?).is_some() {
anyhow::bail!("the rebase state repeats its resolved conflict");
}
}
"continuation-source" => continuation_sources.push(ObjectId::from_hex(value.as_bytes())?),
_ => anyhow::bail!("unsupported rebase state field {key:?}"),
}
}
let state = State {
base: base.context("the rebase state has no base")?,
onto: onto.context("the rebase state has no onto target")?,
tips,
scope,
marker_required: marker_required.context("the rebase state has no marker requirement")?,
checkout_allowed: checkout_allowed.context("the rebase state has no checkout capability")?,
head_ref,
edit_refs,
expected_refs,
resolved,
continuation_sources,
};
validate_state(repo, &state)?;
Ok(Some(state))
}View on GitHub (pinned to e73179060b)