{"record":{"id":"798b510d08228d6d","repo":"GitoxideLabs/gitoxide","slug":"review-commits-cannot-be-copied","errorCode":null,"errorMessage":"review commits cannot be copied","messagePattern":"review commits cannot be copied","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/edit/rebase.rs","lineNumber":562,"sourceCode":"    graph: &HistoryGraph,\n    source: ObjectId,\n    target: ObjectId,\n) -> Result<Plan> {\n    let source_parents = graph\n        .parents_of(source)\n        .context(\"the copy source is not in the loaded history\")?;\n    let [_source_parent] = source_parents.as_slice() else {\n        anyhow::bail!(\"copying a commit requires it to have exactly one parent\");\n    };\n    let source_commit = repo\n        .find_commit(source)\n        .context(\"could not find the copy source\")?\n        .decode()\n        .context(\"could not decode the copy source\")?\n        .into_owned()\n        .context(\"could not own the copy source\")?;\n    if super::review::reference(&source_commit)?.is_some() {\n        anyhow::bail!(\"review commits cannot be copied\");\n    }\n    if source == target {\n        anyhow::bail!(\"the copy source and target must differ\");\n    }\n\n    let mut scope = graph\n        .descendants_in_parent_order(target)\n        .context(\"the copy target is not in the loaded history\")?;\n    scope.retain(|id| *id != target);\n    let mut steps = vec![PlanStep {\n        parent: PlanParent::Existing(target),\n        commit: PlanCommit::Copy(source),\n        squash: Vec::new(),\n    }];\n    let mut step_by_id = HashMap::with_capacity(scope.len());\n    for id in &scope {\n        let parents = graph.parents_of(*id).context(\"an affected copy commit is incomplete\")?;\n        let [parent] = parents.as_slice() else {","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/edit/rebase.rs#L544-L580","documentation":"The copy operation refuses to copy commits that carry a review reference (a commit marked as a review point via `super::review::reference`). Review commits have special meaning in tix's review tracking; copying one would create a duplicate or break the review bookkeeping, so the plan builder bails out before any rewrite.","triggerScenarios":"Calling `copy_insert_plan(repo, graph, source, target)` where the decoded source commit has an associated review reference (i.e. `super::review::reference(&source_commit)?` returns `Some`).","commonSituations":"Copying a commit that is the tip of a review branch or holds review metadata; batch scripts that copy many commits and hit the one carrying the review marker.","solutions":["Copy a different commit that does not carry a review reference.","Remove or complete the review reference on the source commit first, then retry the copy.","If the intent is to reuse review work, use the review-specific workflow instead of a raw copy."],"exampleFix":"// before\ntix copy <review-commit-id> <target>\n\n// after\nif super::review::reference(&source_commit)?.is_some() {\n    eprintln!(\"source carries a review reference; pick another commit\");\n    return Ok(());\n}\ntix copy(source, target)","handlingStrategy":"validation","validationCode":"let commit = repo.find_commit(source)?.decode()?.into_owned()?;\nif super::review::reference(&commit)?.is_some() {\n    eprintln!(\"source is a review commit and cannot be copied\");\n    return Ok(());\n}","typeGuard":"fn is_review_commit(repo: &gix::Repository, id: ObjectId) -> anyhow::Result<bool> {\n    let c = repo.find_commit(id)?.decode()?.into_owned()?;\n    Ok(super::review::reference(&c)?.is_some())\n}","tryCatchPattern":"match copy_insert_plan(&repo, &graph, source, target) {\n    Err(e) if e.to_string().contains(\"review commits\") => eprintln!(\"pick a non-review commit as source\"),\n    other => other?,\n}","preventionTips":["Hide or annotate review commits in commit pickers","Centralize review-reference detection in a helper used before any history-rewriting operation","Complete or clear review references before bulk copy operations"],"tags":["git","rebase","review","unsupported-operation"],"backgroundTag":"unsupported-operation","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"}