fix: carry every ancestor's hunks into stacked descendants - #54
Conversation
|
Warning Review limit reachedNext included review available in 42 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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 |
Greptile SummaryThe stacked-branch update now carries assignments from all ancestors when rebuilding descendant files, preventing inherited hunks from being reverted. Execution across root, linear-descendant, and merge-node branch shapes confirmed the new merging behavior. One cleanup remains in Confidence Score: 4/5The ancestor-merging behavior was exercised for root, linear-descendant, and merge-node cases, with focused helper tests passing. The only finding is a verified maintainability issue: a local mapping is written but never read, so it obscures the active assignment-merging path without changing runtime output. Files Needing Attention:
What T-Rex did
|
|
Removed the now-unused |
11159c5 to
b6d38e6
Compare
In stacked mode a child merged only its direct parent's effective assignments. Files are rebuilt from the merge base, so a grandchild that touched a file its parent did not lost the grandparent's hunks and its commit silently reverted them. Merge all ancestors instead, as the multi-parent path already did.
b6d38e6 to
8b029f1
Compare
Summary
In
_stacked_batch_args, a single-parent group merged onlyeffective[parent]. Ancestor hunks therefore reached a child only through files the parent also edited.Scenario: A edits
f.pyhunk 0 → B (depends on A) edits onlyg.py→ C (depends on B) editsf.pyhunk 1. C's effective assignments weref.py: [1]. C's branch is cut from B's (which contains A's hunk 0), butmaterialize_group_filesrebuildsf.pyfrom the merge base plus hunk 1 only, so C's commit silently deleted A's change.validate_no_conflictsallows this because A and C are related.Fix: merge all of
dag.ancestors(gid), as the multi-parent branch already does. Branch start point and PR base are unchanged.Test plan
test_grandchild_carries_grandparent_hunks_in_shared_file(fails onmain:{'f.py': [1]})uv run ruff check/ruff format --checkcleanuv run pytest -q— 445 passed