Repository navigation
fix(review): report file status from git instead of line counts - #408
Conversation
Appended-only edits were labelled new files and removal-only edits deletions. Read the type from git diff --name-status, and fix the -z numstat parser, which treated rename headers as plain files and misread everything after them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 21 minutes. View limit details
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 |
QA evidence (refreshed)The earlier "after" turn-2 screenshot was clipped by a QA-host bug: Chrome throttles Turn 2: README.md with appended lines is now "Edited", not "Added" |
|
@coderabbitai review |
|



show_changesguessed each file's type from its numstat counts: additions with no removals meant "new", removals with no additions meant "deleted". So appending lines to an existing file was reported as "Added 1 file", and trimming lines as a deletion. In replay QA, a README.md edited with+2 -0was labelledneweven though its patch hadindex 9881f82..3e80947and@@ -1,3 +1,5 @@.The type now comes from
git diff --name-status -zfor the same two refs, mapped to the existingnew/deleted/change/rename-pure/rename-changedvalues. A pure rename is git'sR100, so a renamed binary file with edits is no longer mistaken for a pure rename (its numstat is- -, which previously read as 0/0).While writing the rename test I found that
parseNumstatalso mishandled renames. With-z, git writes a rename header asadds<TAB>dels<TAB>(empty path) followed by the old and new paths, but the parser treated any header with a third field as a plain file. It dropped the rename and then read the old and new paths as headers, which corrupted the entries after it. A rename now consumes its two paths.One new test covers appended-only and removal-only edits, a real new file and a real deletion, a pure and an edited rename, and a modified and a new binary file.
Replay QA (
workspace-turns, base vs this branch; all four scenarios pass on this branch). Turn 1 card, before then after:Turn 2 (README.md
+2 -0) goes from "Added 1 file" to "Edited 1 file". The second image is clipped because the QA host's last card is offscreen when the screenshot is taken. That is a harness artifact unrelated to this change, and the card renders fully once scrolled into view.🤖 Generated with Claude Code