{"record":{"id":"550c220a46e934a7","repo":"GitoxideLabs/gitoxide","slug":"the-command-and-reference-point-to-different-r","errorCode":null,"errorMessage":"the @ command and @ reference point to different results","messagePattern":"the @ command and @ reference point to different results","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/todo.rs","lineNumber":950,"sourceCode":"            }\n        }\n        if verb == \"squash\" {\n            let index = section_last_step.context(\"a squash must follow a command in the same fork\")?;\n            let id = resolve_commit(\n                repo,\n                value.split_whitespace().next().context(\"a squash needs a commit ID\")?,\n            )?;\n            if !scope.contains(&id) {\n                anyhow::bail!(\"a squash is outside the editable history\");\n            }\n            if picked.insert(id, index).is_some() {\n                anyhow::bail!(\"a commit is picked more than once\");\n            }\n            steps[index].squash.push(id);\n            if marked {\n                let target = rebase::PlanParent::Step(index);\n                if checkout_target.is_some_and(|checkout| checkout != target) {\n                    anyhow::bail!(\"the @ command and @ reference point to different results\");\n                }\n                checkout_target = Some(target);\n            }\n            section_has_commit = true;\n            continue;\n        }\n        let parent = cursor.context(\"the first todo command must follow a fork heading\")?;\n        let commit = match verb {\n            \"pick\" => {\n                let value = value.split_whitespace().next().context(\"a pick needs a commit ID\")?;\n                let resolved_id = state.resolved;\n                let full_null = resolved_id.is_some_and(|id| {\n                    value.len() == id.kind().len_in_bytes() * 2 && value.bytes().all(|byte| byte == b'0')\n                });\n                let (id, resolved) = if full_null {\n                    (\n                        resolved_id.context(\"a null pick has no materialized conflict state\")?,\n                        true,","sourceCodeStart":932,"sourceCodeEnd":968,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/todo.rs#L932-L968","documentation":"Thrown when both the `@`-marked command and an `@`-style reference in the todo resolve to different plan steps. The single checkout target must be consistent: the marker and any `@` reference to it must point at the same resulting step.","triggerScenarios":"`parse_plan` processes an `@`-marked squash or command whose computed `PlanParent::Step(index)` differs from a previously recorded `checkout_target`.","commonSituations":"Marking one command with `@` while an `@` reference elsewhere in the todo points at another command's result; hand-editing that moved the marker without moving the reference.","solutions":["Make the `@` reference and the `@`-marked command point at the same step","Keep only one `@` marker and update all references to match its result","Regenerate the todo instead of hand-editing marker placement"],"exampleFix":"// before\n@pick abc123\npick def456\nsquash ghi789 @  # refers to a different result\n// after\npick abc123\n@pick def456\nsquash ghi789 @  # now consistent","handlingStrategy":"validation","validationCode":"// ensure every @ reference resolves to the same step as the single @-marked command\nif marked_lines.len() > 1 || (marked_command_line != referenced_line) {\n    anyhow::bail!(\"@ marker and @ reference must point at the same result\");\n}","typeGuard":"fn targets_consistent(marker_step: usize, reference_step: Option<usize>) -> bool {\n    reference_step.map_or(true, |r| r == marker_step)\n}","tryCatchPattern":"match parse_plan(...) {\n    Err(e) if e.to_string().contains(\"point to different results\") => { /* realign marker and reference */ }\n    other => other?,\n}","preventionTips":["Place the `@` marker only on the command that the `@` reference targets","Change marker and references together in one edit","Validate todo consistency before parsing"],"tags":["git","rebase","checkout-target","consistency"],"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-15T23:17:13.987Z"}