Skip to content

Include untracked file lines in Changes tab line counts#150

Merged
andyrewlee merged 1 commit intomainfrom
fix-lines
Feb 2, 2026
Merged

Include untracked file lines in Changes tab line counts#150
andyrewlee merged 1 commit intomainfrom
fix-lines

Conversation

@andyrewlee
Copy link
Copy Markdown
Owner

@andyrewlee andyrewlee commented Feb 2, 2026

git diff --numstat only covers tracked files, so untracked files (new files, moved files at new paths) contributed zero additions to the TotalAdded count. In refactors with many moved files this produced massively inflated deletion counts with near-zero additions.

Add countUntrackedLines() which reads each untracked file and counts newlines, skipping binary files (null byte in first 8KB), files over 1MB, symlinks, and other non-regular entries. Include the result in TotalAdded so the Changes tab header shows balanced stats.


Open with Devin

git diff --numstat only covers tracked files, so untracked files (new
files, moved files at new paths) contributed zero additions to the
TotalAdded count. In refactors with many moved files this produced
massively inflated deletion counts with near-zero additions.

Add countUntrackedLines() which reads each untracked file and counts
newlines, skipping binary files (null byte in first 8KB), files over
1MB, symlinks, and other non-regular entries. Include the result in
TotalAdded so the Changes tab header shows balanced stats.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional flags.

Open in Devin Review

@andyrewlee andyrewlee merged commit 4544328 into main Feb 2, 2026
1 of 2 checks passed
@andyrewlee andyrewlee deleted the fix-lines branch February 2, 2026 23:05
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