Skip to content

Remove the legacy non-graph commit engine#13666

Merged
krlvi merged 8 commits intomasterfrom
kv-branch-114
May 6, 2026
Merged

Remove the legacy non-graph commit engine#13666
krlvi merged 8 commits intomasterfrom
kv-branch-114

Conversation

@krlvi
Copy link
Copy Markdown
Member

@krlvi krlvi commented May 6, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 6, 2026 13:34
@github-actions github-actions Bot added rust Pull requests that update Rust code CLI The command-line program `but` labels May 6, 2026
@krlvi krlvi force-pushed the kv-branch-114 branch from da0f310 to af3dd6c Compare May 6, 2026 13:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/tracing where 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.

Comment thread crates/but-rules/src/handler.rs Outdated
Comment thread crates/but-workspace/src/legacy/mod.rs
@krlvi krlvi force-pushed the kv-branch-114 branch from 8f4c363 to baf2fc3 Compare May 6, 2026 13:44
Copilot AI review requested due to automatic review settings May 6, 2026 13:49
@krlvi krlvi force-pushed the kv-branch-114 branch from baf2fc3 to d7d3f11 Compare May 6, 2026 13:49
@krlvi krlvi enabled auto-merge May 6, 2026 13:49
@krlvi krlvi disabled auto-merge May 6, 2026 13:51
@krlvi krlvi enabled auto-merge May 6, 2026 13:52
@krlvi krlvi force-pushed the kv-branch-114 branch from fdd6c4f to 03a0ebd Compare May 6, 2026 13:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.

@krlvi krlvi force-pushed the kv-branch-114 branch from 03a0ebd to 2828e25 Compare May 6, 2026 14:03
Copilot AI review requested due to automatic review settings May 6, 2026 14:05
@krlvi krlvi force-pushed the kv-branch-114 branch from 2828e25 to 7d9a4be Compare May 6, 2026 14:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • outcome is a Result from the commit/create+materialize block, but it isn’t ?-propagated before running reload_repo_and_invalidate_workspace, update_workspace_commit, and unapply. 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,
    )?;

@krlvi krlvi force-pushed the kv-branch-114 branch from 7d9a4be to 2d65a75 Compare May 6, 2026 14:23
@krlvi krlvi merged commit c02b195 into master May 6, 2026
42 checks passed
@krlvi krlvi deleted the kv-branch-114 branch May 6, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI The command-line program `but` rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants