fix: count every file in a new directory, not the directory#96
Merged
Conversation
The changed-file count read `git status --porcelain`, whose default `--untracked-files=normal` reports an untracked directory as a single `?? pkg/` entry. An agent writing 25 files into fresh packages showed 4 changed files in the footer and on the session card while the Review tab listed all of them. Ask git for every untracked file instead. The added/deleted totals were already right — they come from `ls-files --others`, which never collapsed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A session writing a whole new package showed 4 changed files in the footer and on its session card, while the Review tab listed 25.
Diffcounted the lines ofgit status --porcelain. Git's default--untracked-files=normalcollapses an untracked directory into one entry:The
+1175 -0line totals were right the whole time — they come fromls-files --others --exclude-standard, which lists files, never directories.Fix
Pass
--untracked-files=allto the status call (internal/project/project.go). One flag; the untracked-line counting below it is unchanged.worktree.goalso runsstatus --porcelain, but only to decide dirty vs clean — the collapse cannot change that answer, so it stays as is.Test plan
TestDiff: two untracked files inside a fresh nested directory. ReportsFiles:4without the flag (the exact symptom),Files:5with it.gofmt -l .clean,go vet ./...clean,go test ./...— 400 passed.biome checkclean (12 pre-existing a11y warnings),vitest run406 passed in 43 files,tsc --noEmitclean,vite buildsucceeds.