fix: drop groups emptied in the interactive editor instead of aborting the session - #129
Open
vitali87 wants to merge 1 commit into
Open
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 30, 2026
Closed
vitali87
force-pushed
the
fix/editor-drops-empty-groups
branch
from
August 30, 2026 16:31
8d2214d to
bdad187
Compare
vitali87
force-pushed
the
fix/editor-drops-empty-groups
branch
from
August 30, 2026 16:38
bdad187 to
d07c3ed
Compare
vitali87
changed the base branch from
fix/reject-out-of-range-hunk-indices
to
fix/interactive-move-recompute-loc
August 30, 2026 16:38
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.
Summary
Moving every hunk out of a group in the interactive editor ended the session with
Groups ['pr-2'] are empty after editing.and exit 1 — all other edits were thrown away. Dissolving a group is a legitimate edit.splitnow drops emptied groups (Dropped empty group(s) after editing: pr-2), rewires their dependants to the nearest kept ancestors (chains of emptied groups collapse transitively; a dropped root leaves its dependants as roots; diamonds keep both surviving parents), then re-validates the reduced plan. It only errors when every group is empty. README's editor paragraph now describes this.Stacked on #60 (stack #74 = #58→#60→#129) because #60 recomputes LOC after each move — without it the dropped group's stale
estimated_locmadevalidate_locfail.Test plan
TestDropEmptyGroups: no-op, single drop with inheritance, dropped root, transitive chain (unmasked), direct-edge dedup, diamond through dropped groupsTestEditorEmptiedGroupEndToEnd: unmocked_interactive_edit→ drop → realvalidate_planreturns[]TestSplitEditorEmptiedGroup: CLI saves the one-group plan; all-empty exits 1move a.py:2 pr-2 pr-1,done) now exits 0 with a valid one-group plan