Why
The Files tab of a change request built its tree, its file count and its
landing summary by parsing one git diff capped at 512 KiB. When a change
carries a large file the cut lands inside that file, and every path named after
the cut is missing from the tree — with no notice that anything was left out.
#143 is the case that found it: deleting the old 546 KB Prism bundle alone exceeds the cap, so the tab said “6 changed” for a change of 302 files, and 296 of them could not be reviewed in the browser at all.
What
The cap existed so a page would not render every hunk of a broad change. But these pages already render exactly one file at a time, so the cap was not protecting them — it was hiding the inventory.
DiffInventoryreadsgit diff --raw --numstat -z: every path with its status, both sides of a rename, and its line counts, in one walk of the trees and with no hunks. The changed-file tree, the file count and the landing summary read it.DiffPathsreads the patch of the one file the Files tab shows, and the commit page keeps its per-fileShowPatchPath. Both return the whole patch.Diffis whole too, for compare. No caller passes a byte bound any more, anddiffCapand the “showing the first 512 KiB” notes are gone.
So a page is as large as the file it shows, and the inventory is the whole change however large it is. Opening a broad change gets cheaper as well: the tree no longer needs the patches of every file to list them.
Checks
vole workflow run verify— all steps pass, includinggo test -race ./....TestDiffInventoryCountsEveryFile— statuses, line counts, a rename’s two paths and a binary file, in both the range form and the two-revision form a landed request uses.TestRequestFilesListsEveryChangedFile— a 600 KiB file that sorts first, and three files after it: the tree counts and links all four. This is the regression for #143.TestCommitPageShowsTheWholeOfOneFilesPatch— the end of a 513 KiB file is on the page, and the file after it still has its row.
Left as it was
Compare still renders every file of a range on one page. It is uncapped now too, so a large comparison is one large page; making it per-file is a separate change, and worth doing if it turns out to matter.