{"record":{"id":"38314ae6eeec06e3","repo":"GitoxideLabs/gitoxide","slug":"the-rebase-state-repeats-marker-required","errorCode":null,"errorMessage":"the rebase state repeats marker-required","messagePattern":"the rebase state repeats marker-required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/todo.rs","lineNumber":697,"sourceCode":"    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                }\n            }\n            \"head-ref\" => {\n                let encoded = value.as_bytes().as_bstr();\n                let (name, consumed) = gix::quote::ansi_c::undo(encoded)\n                    .map_err(gix::Exn::into_error)\n                    .context(\"could not unquote the recorded HEAD ref\")?;\n                if !encoded[consumed..].trim().is_empty() {\n                    anyhow::bail!(\"the recorded HEAD ref has trailing data\");\n                }\n                let name = gix::refs::FullName::try_from(name.as_ref()).context(\"the recorded HEAD ref is invalid\")?;\n                if head_ref.replace(name).is_some() {\n                    anyhow::bail!(\"the rebase state repeats its HEAD ref\");","sourceCodeStart":679,"sourceCodeEnd":715,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/todo.rs#L679-L715","documentation":"The rebase todo/state parser in gix-tix (`parse_state`) found a `marker-required` line in the rebase state file, but a `marker-required` line was already seen earlier in the file. The state format allows each scalar field to appear at most once, so a second occurrence is rejected as a malformed or corrupted state file. This prevents silently overwriting a previously recorded value.","triggerScenarios":"Parsing a rebase state file via `parse`/`parse_state` (gix-tix/src/edit/todo.rs:697) where two `marker-required <bool>` lines exist. Typically caused by a hand-edited or concurrently-written state file, or by a corrupted `.git/rebase-merge`-style state.","commonSituations":"Manually editing a rebase state file and accidentally duplicating a line; merge conflicts while a state file was modified; tooling that appends instead of replacing fields; state files copied between worktrees.","solutions":["Open the rebase state file and remove the duplicate `marker-required` line, keeping exactly one.","If the state file is corrupted or unclear, abort the operation and let the tool regenerate state from scratch.","Check for other running gix/gitoxide processes that may have written the state file concurrently."],"exampleFix":"// before (state file)\nmarker-required true\nmarker-required false\n// after\nmarker-required true","handlingStrategy":"validation","validationCode":"fn state_file_is_clean(text: &str) -> bool {\n    text.lines().filter(|l| l.starts_with(\"marker-required \")).count() <= 1\n}","typeGuard":null,"tryCatchPattern":"match todo::parse(state_text) {\n    Ok(state) => apply(state),\n    Err(e) if e.to_string().contains(\"repeats marker-required\") => {\n        eprintln!(\"corrupt state: duplicate marker-required; regenerate state\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Never hand-edit rebase state files; regenerate them via the tool.","Keep exactly one line per scalar field when constructing state files programmatically.","Take the state-file lock (or check for concurrent processes) before writing."],"tags":["rebase","state-parsing","duplicate-field","git"],"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"}