{"record":{"id":"40c5d89558fec095","repo":"gitbutlerapp/gitbutler","slug":"a-parent-in-the-output-graph-is-not-a-pick","errorCode":null,"errorMessage":"A parent in the output graph is not a pick","messagePattern":"A parent in the output graph is not a pick","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-rebase/src/graph_rebase/rebase.rs","lineNumber":53,"sourceCode":"                    // Immutable picks are copied verbatim: the commit keeps its\n                    // id, so there's no cherry-pick to run and nothing to record\n                    // in the history mapping.\n                    output_graph.add_node(Step::Pick(pick))\n                }\n                Step::Pick(pick) => {\n                    let graph_parents = collect_ordered_parents(&self.graph, step_idx);\n                    let ontos = match pick.preserved_parents.clone() {\n                        Some(ontos) => ontos,\n                        None => graph_parents\n                            .iter()\n                            .map(|idx| {\n                                let Some(new_idx) = graph_mapping.get(idx) else {\n                                    bail!(\"A matching parent can't be found in the output graph\");\n                                };\n\n                                match output_graph[*new_idx] {\n                                    Step::Pick(Pick { id, .. }) => Ok(id),\n                                    _ => bail!(\"A parent in the output graph is not a pick\"),\n                                }\n                            })\n                            .collect::<Result<Vec<_>>>()?,\n                    };\n\n                    let outcome = cherry_pick(\n                        &self.repo,\n                        pick.id,\n                        &ontos,\n                        pick.pick_mode,\n                        pick.tree_merge_mode,\n                        pick.sign_commit,\n                    )?;\n\n                    if matches!(outcome, CherryPickOutcome::ConflictedCommit(_))\n                        && !pick.conflictable\n                    {\n                        bail!(","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-rebase/src/graph_rebase/rebase.rs#L35-L71","documentation":"During graph-based rebase output reconstruction, a step's parent index was remapped into the output graph, but the node at the new index is not a Pick step (e.g. a Reference or marker node). The rebase machinery requires every parent of a cherry-picked commit in the output graph to be an actual picked commit carrying a commit id. This indicates the output graph structure diverged from the invariants the rebase algorithm maintains.","triggerScenarios":"Calling the rebase operation when graph_mapping maps a step's parent to an output-graph node that is a non-Pick Step variant — typically a Reference step or internal marker node becoming the parent of a pick.","commonSituations":"Rebases involving virtual branch reference steps interleaved with picks; bugs or regressions in graph construction when references are re-parented; corrupted or hand-edited branch graphs.","solutions":["Inspect the rebase steps: ensure reference steps are ordered so they never become the parent of a pick in the output graph.","Verify the graph_mapping/output_graph construction for recent changes to but-rebase; this is an invariant violation, likely an internal bug — report with the failing step list.","Reconstruct the rebase plan without reference steps in parent positions and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn all_parents_are_picks(steps: &[RebaseStep]) -> bool {\n    // references must never precede a pick that depends on them as a parent\n    !steps.iter().zip(steps.iter().skip(1)).any(|(prev, next)| {\n        matches!(prev, RebaseStep::Reference(_)) && matches!(next, RebaseStep::Pick(_))\n    })\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep reference steps ordered after the picks they annotate","Validate rebase plans before running them","Treat this as a bug report signal: capture the full step list when it fires"],"tags":["rebase","graph","invariant-violation"],"backgroundTag":"internal-invariant-violation","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}