{"record":{"id":"25e415c54e4464b4","repo":"GitoxideLabs/gitoxide","slug":"the-undo-sentinel-has-the-wrong-title","errorCode":null,"errorMessage":"the undo sentinel has the wrong title","messagePattern":"the undo sentinel has the wrong title","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/undo.rs","lineNumber":855,"sourceCode":"        .into_owned()\n        .context(\"could not own an undo queue commit\")?;\n    ensure!(\n        commit.tree == ObjectId::empty_tree(repo.object_hash()),\n        \"an undo queue commit does not use the empty tree\"\n    );\n    let message = gix::objs::commit::MessageRef::from_bytes(&commit.message);\n    let title = message\n        .title\n        .to_str()\n        .context(\"an undo operation title is not UTF-8\")?\n        .to_owned();\n    validate_title(&title)?;\n    let body = message.body.context(\"an undo queue commit has no metadata body\")?;\n    let changes = parse_config(repo, body)?;\n    let parent = commit.parents.first().copied();\n    match parent {\n        None => {\n            ensure!(title == START_TITLE, \"the undo sentinel has the wrong title\");\n            ensure!(changes.is_empty(), \"the undo sentinel contains reference changes\");\n        }\n        Some(parent) => {\n            ensure!(!changes.is_empty(), \"an undo operation contains no reference changes\");\n            let expected = retention_parents(repo, parent, &changes)?;\n            ensure!(\n                commit.parents.as_slice() == expected,\n                \"an undo commit has invalid retention parents\"\n            );\n        }\n    }\n    Ok(ParsedCommit { parent, title, changes })\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n","sourceCodeStart":837,"sourceCodeEnd":873,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/undo.rs#L837-L873","documentation":"The sentinel is the root commit of the undo queue and must carry the reserved `START_TITLE` title. `parse_commit` throws this when it encounters a parentless queue commit whose title differs, meaning the queue was seeded with a malformed or hand-made root commit.","triggerScenarios":"Calling `parse_commit` (via `is_queue_commit` or `load`) on a parentless commit in the undo queue whose title is not `START_TITLE`.","commonSituations":"Hand-crafting the queue's root commit with a custom message, or using a pre-existing root commit (e.g. an initial repo commit) as the sentinel.","solutions":["Recreate the undo queue so it starts from a sentinel commit created by the library with the reserved title","Delete the queue ref and record a fresh undo operation to regenerate a valid sentinel","Never manually write the sentinel commit; always initialize via the library"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match undo.load(repo) {\n    Err(e) if e.to_string().contains(\"sentinel\") => {\n        // delete queue ref, re-initialize undo session\n    }\n    other => other?,\n}","preventionTips":["Initialize the queue only via the library so the sentinel title is correct","Do not hand-craft the root commit of the queue"],"tags":["git","undo","corruption"],"backgroundTag":"invalid-state-transition","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"}