Skip to content

move-commit: Forget about the workspace projection#13154

Draft
estib-vega wants to merge 1 commit intomasterfrom
move-commit-forgets-about-the-workspace
Draft

move-commit: Forget about the workspace projection#13154
estib-vega wants to merge 1 commit intomasterfrom
move-commit-forgets-about-the-workspace

Conversation

@estib-vega
Copy link
Copy Markdown
Contributor

@estib-vega estib-vega commented Apr 2, 2026

  • Remove retrieve_commit_and_container and its workspace dependency.
  • Stop extracting full subject commit and source segment;only use the
    selectable selector returned by editor.find_selectable.
  • Replace index/segment-based child/parent determination with selector
    based helpers that query the editor (determine_child_selector
    and_parent).
  • Update imports and comments to the new assumption about editor.

This simplifies the move operation, coupling the workspace, and prepares
the code further graph-centric changes.


This is part 1 of 1 in a stack made with GitButler:

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Ignored Ignored Preview Apr 2, 2026 0:59am

Request Review

@github-actions github-actions bot added the rust Pull requests that update Rust code label Apr 2, 2026
@estib-vega estib-vega requested a review from Copilot April 2, 2026 00:58
- Remove retrieve_commit_and_container and its workspace dependency.
- Stop extracting full subject commit and source segment;only use the
  selectable selector returned by editor.find_selectable.
- Replace index/segment-based child/parent determination with selector
  based helpers that query the editor (determine_child_selector
  and_parent).
- Update imports and comments to the new assumption about editor.

This simplifies the move operation, coupling the workspace, and prepares
the code further graph-centric changes.
@estib-vega estib-vega force-pushed the move-commit-forgets-about-the-workspace branch from fb67d54 to ac0cfa5 Compare April 2, 2026 00:59
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 simplifies the Rust move_commit operation in but-workspace by removing reliance on the workspace projection/segment containers and instead determining disconnect targets directly from the rebase editor’s step graph (selectors + step lookups). This aims to reduce coupling and move the implementation toward more graph-centric operations.

Changes:

  • Removed workspace-projection-based context discovery (retrieve_commit_and_containers) from move_commit.
  • Replaced segment index-based child/parent selection with selector-based helpers that query the editor.
  • Updated documentation/comments and imports to match the new assumptions.

Comment on lines +69 to +70
let mut children = editor.direct_children(subject_commit_selector)?;
children.sort_by_key(|(_, order)| *order);
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

Editor doesn't define direct_children (and there is no trait providing it in scope). A repo-wide search only finds this call site, so this will not compile. Either add direct_children to but_rebase::graph_rebase::Editor (likely returning the incoming neighbors + edge order, normalized to Selectors), or rework this helper to use an existing API for enumerating incoming edges/children.

Copilot uses AI. Check for mistakes.
Comment on lines +116 to +117
let mut parents = editor.direct_parents(subject_commit_selector)?;
parents.sort_by_key(|(_, order)| *order);
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

Editor doesn't define direct_parents (and there is no trait providing it in scope). A repo-wide search only finds this call site, so this will not compile. Either add direct_parents to but_rebase::graph_rebase::Editor (likely returning outgoing neighbors + edge order, normalized to Selectors), or rework this helper to use an existing API for enumerating outgoing edges/parents.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants