move-commit: Forget about the workspace projection#13154
move-commit: Forget about the workspace projection#13154estib-vega wants to merge 1 commit intomasterfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
- 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.
fb67d54 to
ac0cfa5
Compare
There was a problem hiding this comment.
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) frommove_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.
| let mut children = editor.direct_children(subject_commit_selector)?; | ||
| children.sort_by_key(|(_, order)| *order); |
There was a problem hiding this comment.
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.
| let mut parents = editor.direct_parents(subject_commit_selector)?; | ||
| parents.sort_by_key(|(_, order)| *order); |
There was a problem hiding this comment.
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.
selectable selector returned by editor.find_selectable.
based helpers that query the editor (determine_child_selector
and_parent).
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: