You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compare code semantically across a force push in review bundles #606
After a force push, review-bundle.sh --since points a reviewer to a tree diff or a git range-diff. Both compare lines. When an author reworks a commit, the range-diff reads almost as long as the whole diff: 925 of 1200 lines on #586, 624 of 1284 on #584.
Current behavior
diffmodel.py pairs moved units by indentation, which workbench.md calls a guess at syntax and not a parse. since.range-diff.txt shows a reworked commit as removed and added lines, so a rename or a moved function reads as new code.
Desired outcome
A reviewer reading a rewritten pull request sees which functions or blocks changed in meaning, and which only moved or were renamed, without rereading the whole commit.
Scope
A comparison that builds on diffmodel.py's unit pairing.
@Alan52254 Before code, state what a reviewer gets and how it is checked: the file the bundle writes and its format, and for each of #585, #584 and #586 what the comparison must report, meaning which units it calls moved or renamed and which it calls changed. Those three become the test cases.
When --since compares a rewrite, the bundle also writes since.units.txt next to since.diff or since.range-diff.txt. It is built from diffmodel.reading on the diff between the two heads, limited to the files the pull request touches, and it is absent when the comparison falls back to the whole diff. It says what to read first; the whole diff is still reviewed.
The first line is # units old=<sha7> new=<sha7> status=<rewritten|rebased>. Every other line is one unit, tab separated and sorted by path and new line: <verdict> <path> <unit> <detail>. The verdict is added, removed, changed, renamed or moved. The unit is the first line of the function, class or block that collect_units cuts, or the hunk section when none is cut. The detail is +<n> -<m> for changed, <old> -> <new> for renamed and from <path>:<line> for moved.
tests/test_skill_scripts.py feeds the recorded diff between the two heads of each case below and compares the file with the lines listed. reading reports no moved unit on any of the three, so the moved verdict comes from a small fixture.
The two configured_duration have different signatures and sit in different files, so they are two additions and not a move. The new tests in tests/unit/bin.rs and tests/browser/interviewer-voice.test.js are added, and the other touched files are changed without a unit.
renamed tests/browser/example-board-ui.test.js test("the button or Escape shrinks the board, but not from the editor or mid-stroke" -> test("the button or Escape shrinks the board, but not from a sidebar field or mid-stroke"
renamed tests/browser/example-board-ui.test.js test("closing Example drawing shrinks an expanded board" -> test("closing Example drawing shrinks an expanded board and frees the editor"
renamed tests/browser/example-board-ui.test.js test("an expanded board covers Jim's Hide avatar button" -> test("a click where Hide avatar sits reaches the expanded board, not the stage"
changed web/example-board.js export function mountExampleBoard
changed web/interview-drawer.js export function mountInterviewDrawer
changed web/interview.js function bindEvents
The tests added in tests/browser/example-board-ui.test.js, interview-layout.test.js and run-shortcut.test.js are added.
Activity
jserv commentedon Nov 6, 2026
@Alan52254 Before code, state what a reviewer gets and how it is checked: the file the bundle writes and its format, and for each of #585, #584 and #586 what the comparison must report, meaning which units it calls moved or renamed and which it calls changed. Those three become the test cases.
Alan52254 commentedon Nov 7, 2026
When
--sincecompares a rewrite, the bundle also writessince.units.txtnext tosince.difforsince.range-diff.txt. It is built fromdiffmodel.readingon the diff between the two heads, limited to the files the pull request touches, and it is absent when the comparison falls back to the whole diff. It says what to read first; the whole diff is still reviewed.The first line is
# units old=<sha7> new=<sha7> status=<rewritten|rebased>. Every other line is one unit, tab separated and sorted by path and new line:<verdict> <path> <unit> <detail>. The verdict isadded,removed,changed,renamedormoved. The unit is the first line of the function, class or block thatcollect_unitscuts, or the hunk section when none is cut. The detail is+<n> -<m>forchanged,<old> -> <new>forrenamedandfrom <path>:<line>formoved.tests/test_skill_scripts.pyfeeds the recorded diff between the two heads of each case below and compares the file with the lines listed.readingreports no moved unit on any of the three, so themovedverdict comes from a small fixture.#585,
d8d4fe8to6bf2003, one base:#584,
e64598eto4d13dd5, base moved:The two
configured_durationhave different signatures and sit in different files, so they are two additions and not a move. The new tests intests/unit/bin.rsandtests/browser/interviewer-voice.test.jsareadded, and the other touched files arechangedwithout a unit.#586,
caff855tod6e5200, base moved:The tests added in
tests/browser/example-board-ui.test.js,interview-layout.test.jsandrun-shortcut.test.jsareadded.