Skip to content

revive but worktree subcommands#14213

Merged
krlvi merged 1 commit into
masterfrom
revive-worktree-no-graph
Jun 13, 2026
Merged

revive but worktree subcommands#14213
krlvi merged 1 commit into
masterfrom
revive-worktree-no-graph

Conversation

@krlvi

@krlvi krlvi commented Jun 13, 2026

Copy link
Copy Markdown
Member

@estib-vega @Caleb-T-Owens - the subtree stuff should "work" now. it's still a hidden subcommand until we figure stuff out

Copilot AI review requested due to automatic review settings June 13, 2026 08:08
@github-actions github-actions Bot added rust Pull requests that update Rust code CLI The command-line program `but` labels Jun 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Revives the legacy but worktree CLI flow by reintroducing end-to-end CLI tests and modernizing the but-worktrees crate APIs so worktree creation/list/destroy/integration can be driven from the current workspace/graph plumbing (instead of Context-centric legacy APIs).

Changes:

  • Added legacy CLI integration tests for but worktree new/list/integrate/destroy, including the “nothing to integrate” case.
  • Refactored but-worktrees to accept narrow inputs (gix::Repository, but_graph::Workspace, data_dir) and switched worktree creation to git worktree add --detach (avoiding hidden branches).
  • Reimplemented integration using the graph rebase editor/materialization path and added new/updated tests to cover conflict and safety behaviors (including aborting when main worktree has uncommitted changes).

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/but/tests/but/command/worktree.rs New legacy CLI tests covering the full worktree journey and destroy modes
crates/but/tests/but/command/mod.rs Registers the new worktree test module behind legacy
crates/but/src/lib.rs Adjusts legacy worktree subcommand error propagation
crates/but/src/command/legacy/worktree.rs Adds CLI output for NothingToIntegrate dry-run status
crates/but-worktrees/tests/worktree/worktree_new.rs Simplifies/modernizes worktree-new tests via shared helpers
crates/but-worktrees/tests/worktree/worktree_destroy.rs Updates destroy tests to new narrow APIs/helpers
crates/but-worktrees/tests/worktree/various.rs Updates/expands integration behavior tests (including abort-on-uncommitted-changes)
crates/but-worktrees/tests/worktree/main.rs Introduces helper wrappers to derive narrow inputs from Context for tests
crates/but-worktrees/src/new.rs Changes worktree_new signature; creates detached worktrees under data_dir
crates/but-worktrees/src/list.rs Changes worktree_list signature to take &gix::Repository
crates/but-worktrees/src/lib.rs Updates serde behavior for WorktreeId and worktree JSON fields
crates/but-worktrees/src/integrate.rs Adds NothingToIntegrate; rewrites integration to graph-editor + materialize
crates/but-worktrees/src/git.rs Updates git worktree add/remove invocation and error/log handling
crates/but-worktrees/src/destroy.rs Changes destroy APIs to take &gix::Repository and uses new list API
crates/but-worktrees/Cargo.toml Drops legacy deps, adds but-graph + but-serde, moves but-ctx to dev-deps
crates/but-serde/src/lib.rs Adds bstring_lossy::deserialize support
crates/but-api/src/legacy/worktree.rs Adapts legacy API layer to the new but-worktrees signatures
Cargo.lock Locks updated dependency graph

Comment thread crates/but/tests/but/command/worktree.rs
Comment thread crates/but-worktrees/src/integrate.rs Outdated
Comment thread crates/but-worktrees/tests/worktree/various.rs Outdated
@krlvi krlvi force-pushed the revive-worktree-no-graph branch from 7beaca5 to 9547b84 Compare June 13, 2026 08:18
@krlvi krlvi merged commit b75afd3 into master Jun 13, 2026
52 checks passed
@krlvi krlvi deleted the revive-worktree-no-graph branch June 13, 2026 08:47
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.

2 participants