Conversation
Caleb-T-Owens
approved these changes
May 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the legacy (non-graph) commit engine from but-workspace and migrates remaining call sites to the graph-rebase-based commit APIs, while deleting the legacy engine’s associated test suite.
Changes:
- Replace legacy commit-engine usage with
but_rebase::graph_rebase::Editor+but_workspace::commit::{commit_create, commit_amend}in branch removal, CLI amend, rules processing, and simple automation flows. - Remove the legacy commit engine module and large legacy commit-engine test coverage from
but-workspace. - Update crate dependencies to include
but-rebase/tracingwhere needed.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/gitbutler-branch-actions/src/branch_manager/branch_removal.rs | Switch “WIP Assignments” commit creation during unapply from legacy engine to graph-rebase commit creation. |
| crates/but/src/command/legacy/rub/amend.rs | Migrate amend command to graph-rebase commit_amend and return the rewritten commit id. |
| crates/but-rules/src/handler.rs | Migrate rule-driven amend operations to graph-rebase commit_amend. |
| crates/but-rules/Cargo.toml | Add but-rebase and tracing dependencies for the new implementation. |
| crates/but-api/src/legacy/workspace.rs | Update stash_into_branch to use graph-rebase commit creation and adapt output shaping. |
| crates/but-action/src/simple.rs | Migrate simple “handle changes” commit creation flow to graph-rebase commit_create. |
| crates/but-workspace/src/legacy/mod.rs | Remove export of the legacy commit engine module. |
| crates/but-workspace/src/legacy/ui.rs | Remove StackEntryNoOpt::try_new helper previously used by the legacy engine. |
| crates/but-workspace/src/legacy/commit_engine/* | Delete legacy commit engine implementation files. |
| crates/but-workspace/tests/workspace/* | Remove legacy commit-engine test modules and associated helpers. |
| Cargo.lock | Lockfile updates for new dependency graph. |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 21 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
crates/but-api/src/legacy/workspace.rs:413
outcomeis aResultfrom the commit/create+materialize block, but it isn’t?-propagated before runningreload_repo_and_invalidate_workspace,update_workspace_commit, andunapply. If the commit step fails, these follow-up mutations will still run and can both leave the repo/workspace in an unexpected state and/or mask the original error (because later?calls can override it). Consider applying?at assignment (let outcome = { ... }?;) or immediately after, then proceed with the subsequent workspace updates only on success.
ctx.reload_repo_and_invalidate_workspace(perm)?;
gitbutler_branch_actions::update_workspace_commit(ctx, false)
.context("failed to update gitbutler workspace")?;
ctx.branch_manager().unapply(
stack.id,
perm,
false,
Vec::new(),
ctx.settings.feature_flags.cv3,
)?;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.