Skip to content

fix(review): report file status from git instead of line counts - #408

Merged
Waishnav merged 1 commit into
mainfrom
fix/review-file-status
Oct 26, 2026
Merged

Waishnav merged 1 commit into
mainfrom
fix/review-file-status

Conversation

@Waishnav

@Waishnav Waishnav commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

show_changes guessed 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 -0 was labelled new even though its patch had index 9881f82..3e80947 and @@ -1,3 +1,5 @@.

The type now comes from git diff --name-status -z for the same two refs, mapped to the existing new / deleted / change / rename-pure / rename-changed values. A pure rename is git's R100, 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 parseNumstat also mishandled renames. With -z, git writes a rename header as adds<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:

before-turn1-card.png
after-turn1-card.png

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.

before-turn2-card.png
after-turn2-card.png

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a003d8df-a40e-4291-86f9-2781ef3df3ca
Commits

Reviewing files that changed from the base of the PR and between 531d3f9 and 5fb749f.

Files selected for processing: 2
  • src/review-checkpoints.test.ts
  • src/review-checkpoints.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Waishnav
Waishnav marked this pull request as ready for review October 25, 2026 21:37
Waishnav pushed a commit that referenced this pull request Oct 25, 2026
@Waishnav

Copy link
Copy Markdown
Owner Author

QA evidence (refreshed)

The earlier "after" turn-2 screenshot was clipped by a QA-host bug: Chrome throttles requestAnimationFrame in off-screen cross-origin iframes, so cards below the fold kept their pre-render height. That's fixed in #404 (62939e38). Rerun of workspace-turns against this branch: PASS.

Turn 2: README.md with appended lines is now "Edited", not "Added"
after-turn2-card.png

Turn 1: A src/farewell.ts, M src/greet.ts
after-turn1-card.png

Full page
after-workspace-turns-page.png

@Waishnav

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Waishnav
Waishnav merged commit b914f74 into main Oct 26, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant