{"record":{"id":"0193f7b22d2279fa","repo":"gitbutlerapp/gitbutler","slug":"failed-to-extract-described-changes-from-source-commit","errorCode":null,"errorMessage":"Failed to extract described changes from source commit","messagePattern":"Failed to extract described changes from source commit","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-workspace/src/commit/move_changes.rs","lineNumber":82,"sourceCode":"    let source_tree_id = {\n        let source_commit = source_commit.clone().attach(editor.repo());\n        if source_commit.is_conflicted() {\n            bail!(\"Source commit must not be conflicted\")\n        }\n        source_commit.tree\n    };\n\n    let (source_tree_without_changes_id, dropped_diffs) = create_tree_without_diff(\n        editor.repo(),\n        ChangesSource::Commit {\n            id: source_commit.id,\n        },\n        changes_to_move,\n        context_lines,\n    )?;\n\n    if !dropped_diffs.is_empty() {\n        bail!(\"Failed to extract described changes from source commit\");\n    }\n\n    let new_source_commit_id = {\n        let mut new_source_commit = source_commit.clone();\n        new_source_commit.tree = source_tree_without_changes_id;\n        editor.new_commit(new_source_commit, DateMode::CommitterUpdateAuthorKeep)?\n    };\n\n    editor.replace(source_selector, Step::new_pick(new_source_commit_id))?;\n\n    // Rebase and get potentially rebased destination commit\n    let mut editor = editor.rebase()?.into_editor();\n    let (_, rebased_destination_commit) = editor.find_selectable_commit(destination_selector)?;\n    let destination_tree_id = {\n        let rebased_destination_commit = rebased_destination_commit.clone().attach(editor.repo());\n        if rebased_destination_commit.is_conflicted() {\n            bail!(\"Destination commit must not be conflicted\")\n        }","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-workspace/src/commit/move_changes.rs#L64-L100","documentation":"After building a source tree with the requested changes removed, some of the described diffs were not found in the source commit, so the extraction is incomplete. The library bails rather than silently producing a source commit that still contains (part of) the changes.","triggerScenarios":"move_changes_between_commits is called with changes_to_move that don't exactly match hunks present in the source commit's tree (stale file paths, wrong line ranges, changes already moved out).","commonSituations":"UI state was captured before the commit changed (e.g. an amend or rebase shifted the diffs); describing changes by file/line after the file was edited elsewhere.","solutions":["Recompute the change descriptions from the source commit's current tree and retry","Verify the specified changes actually exist in the source commit (paths and hunks)","If partial extraction is acceptable, split the request into individually-verified changes"],"exampleFix":"// before\neditor.move_changes_between_commits(src, dst, stale_changes, ctx)?;\n// after\nlet fresh = describe_changes_from(src, repo)?; // re-derive from current tree\neditor.move_changes_between_commits(src, dst, fresh, ctx)?;","handlingStrategy":"validation","validationCode":"// ensure the described changes exist in the source commit before moving\nfor change in &changes_to_move {\n    assert_change_present_in(change, source_commit_tree)?;\n}","typeGuard":null,"tryCatchPattern":"match editor.move_changes_between_commits(src, dst, changes, ctx) {\n    Err(e) if e.to_string().contains(\"Failed to extract described changes\") => refresh_descriptions_and_retry(),\n    other => other,\n}","preventionTips":["Re-derive change descriptions from the current tree, not cached state","Refresh UI-captured hunks after any amend/rebase","Verify paths and hunks exist in the source commit before moving"],"tags":["git","move","diff","stale-state"],"backgroundTag":"resource-not-found","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"}