{"record":{"id":"729c503819ebd567","repo":"GitoxideLabs/gitoxide","slug":"the-review-return-reference-no-longer-descends-fro","errorCode":null,"errorMessage":"the review return reference no longer descends from the reviewed commit","messagePattern":"the review return reference no longer descends from the reviewed commit","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/review.rs","lineNumber":279,"sourceCode":"        }\n        Some((id, None))\n    } else {\n        return_name\n            .map(|name| {\n                let Some(mut reference) = repo.try_find_reference(name.as_ref())? else {\n                    return Ok(None);\n                };\n                let checkout_reference = if name.as_bstr().starts_with(history::PIN_PREFIX) {\n                    reference.target().try_name().map(ToOwned::to_owned)\n                } else {\n                    Some(name)\n                };\n                let id = reference\n                    .peel_to_id()\n                    .context(\"the review return reference does not resolve\")?\n                    .detach();\n                if !graph.is_ancestor(tip, id) {\n                    anyhow::bail!(\"the review return reference no longer descends from the reviewed commit\");\n                }\n                Ok(Some((id, checkout_reference)))\n            })\n            .transpose()?\n            .flatten()\n    };\n    if fallback.is_none() && has_return && checkout.is_none() {\n        return Ok(Finish::SelectReturn { tip });\n    }\n    for (label, id) in [(\"reviewed commit\", tip), (\"review base\", base)] {\n        let endpoint = repo.find_commit(id)?.decode()?.into_owned()?;\n        if super::rebase::is_pending(&endpoint) {\n            anyhow::bail!(\"{label} has a pending rebase\");\n        }\n    }\n    match super::rebase::finish_review_with_progress(\n        &repo,\n        graph,","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/review.rs#L261-L297","documentation":"During finish, the stored review return reference is resolved and validated: it must still be a descendant of the reviewed commit (tip). If the reference resolves to a commit that no longer descends from the tip, the return point has diverged and the review cannot safely be finished onto it.","triggerScenarios":"Calling `finish_with_progress` with no fallback while the return reference (return_to / legacy reattach name) has been moved, rebased, or reset so it no longer contains the review tip.","commonSituations":"The branch recorded as the return point was force-pushed or rebased while the review was active; the user reset the return branch backwards; history rewriting tools moved the return branch onto an unrelated line.","solutions":["Move the return reference back onto a commit descending from the review tip, or fast-forward it.","Supply an explicit valid fallback commit via the fallback parameter instead of relying on the stale reference.","Inspect the return branch (`git log <return-ref>`) and rebase or reset it to re-include the reviewed work."],"exampleFix":"// before: return ref diverged, finish fails\nreview::finish(repo, graph, review_id, None)?;\n// after: pass a known-good descendant explicitly\nreview::finish(repo, graph, review_id, Some(current_branch_tip))?;","handlingStrategy":"validation","validationCode":"if let Some(name) = return_ref {\n    let id = repo.try_find_reference(name.as_ref())?.context(\"missing return ref\")?.peel_to_id()?.detach();\n    if !graph.is_ancestor(review_tip, id) {\n        return Err(anyhow::anyhow!(\"return ref diverged; rebase or reset it before finishing\"));\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid force-pushing or resetting the branch used as the review return point while a review is active.","Handle `Finish::SelectReturn` by prompting the user to pick a valid return commit.","Fast-forward the return branch to include reviewed work instead of rebasing it away."],"tags":["git","review-workflow","invalid-state-transition"],"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"}