{"record":{"id":"aeff57fe1c19b5f3","repo":"GitoxideLabs/gitoxide","slug":"a-pick-is-outside-the-editable-history","errorCode":null,"errorMessage":"a pick is outside the editable history","messagePattern":"a pick is outside the editable history","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/todo.rs","lineNumber":974,"sourceCode":"        }\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,\n                    )\n                } else {\n                    (resolve_commit(repo, value)?, false)\n                };\n                if !scope.contains(&id) {\n                    anyhow::bail!(\"a pick is outside the editable history\");\n                }\n                if picked.contains_key(&id) {\n                    anyhow::bail!(\"a commit is picked more than once\");\n                }\n                if resolved {\n                    rebase::PlanCommit::Resolved(id)\n                } else {\n                    rebase::PlanCommit::Pick(id)\n                }\n            }\n            \"empty\" => {\n                let title = if value.trim().is_empty() { tail } else { value.trim() };\n                if title.is_empty() {\n                    anyhow::bail!(\"an empty commit needs a title\");\n                }\n                rebase::PlanCommit::Empty(BString::from(title))\n            }\n            _ => anyhow::bail!(\"unsupported rebase todo command {verb:?}\"),","sourceCodeStart":956,"sourceCodeEnd":992,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/todo.rs#L956-L992","documentation":"Validation inside `edit::todo::parse`. Each `pick` line's commit ID is checked against the set of commits that belong to the editable history; if the picked commit resolves to a commit outside that history (or an ID that cannot be resolved into it), parsing bails. This prevents the resulting rebase plan from silently grafting foreign commits into the edited branch. Fired by hand-edited todo files referencing hashes not part of the displayed history; fix by picking only commits listed in the editable range or removing the line.","triggerScenarios":"`parse_plan` resolves a `pick <oid>` (or an abbreviated ID via `resolve_commit`) whose commit is not in the scope set.","commonSituations":"Picking a commit from another branch or from outside the forked range; typos or stale IDs copied from a previous rebase; abbreviated IDs that resolve to an unintended out-of-scope commit.","solutions":["Reference a commit ID inside the editable history","Widen the plan scope to include the desired commit","Delete the pick line if the commit should not be replayed"],"exampleFix":"// before\npick 9999999  # outside the edited range\n// after\npick abc1234  # inside the edited range","handlingStrategy":"validation","validationCode":"let id = repo.rev_parse_single(value)?;\nif !scope.contains(&id) {\n    anyhow::bail!(\"pick target {} is outside the editable history\", id.shorten_or_id());\n}","typeGuard":"fn pick_in_scope(id: gix::Id<'_>, scope: &HashSet<gix::oid::ObjectId>) -> bool {\n    scope.contains(id.object_id())\n}","tryCatchPattern":"match parse_plan(...) {\n    Err(e) if e.to_string().contains(\"a pick is outside the editable history\") => { /* correct the pick line */ }\n    other => other?,\n}","preventionTips":["Verify each picked commit belongs to the edited range before writing the todo","Avoid copying pick lines from unrelated rebase sessions","Beware abbreviated IDs that may resolve to out-of-scope commits"],"tags":["git","rebase","pick","scope-validation"],"backgroundTag":"invalid-argument-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"}