Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Read a change's file list without its patch, and never cut a diff

f64c77e4950c1759f336d3bc1849ead86e8b8ebf · Keenan Nemetz · 8d ago · parent 11720250

Read a change's file list without its patch, and never cut a diff

The review tree, the file count and the landing summary were all parsed out of
one `git diff` capped at 512 KiB. When a change carries a large file the cut
lands inside it, and every file named after the cut is missing from the tree:
reviewing #143, a 546 KB deletion hid the 296 files that came after it while
the tab still said "6 changed". The cap existed to stop a page rendering every
hunk, but the pages it guarded already render one file at a time.

The inventory and the patch are separate reads now. DiffInventory runs
`git diff --raw --numstat -z`, which names every file with its status and line
counts in one walk of the trees and generates no hunks; the changed-file tree,
the counts and the landing summary read that. The Files tab then asks for the
one file it shows with DiffPaths, and the commit page keeps its per-file
ShowPatchPath. Nothing is capped by bytes: a page is as large as the file it
shows, and the inventory is the whole change however large it is.

Compare still renders every file of a range at once, and is uncapped too, so a
large comparison is one large page. Making that per-file is the next step if it
turns out to matter.

TestDiffInventoryCountsEveryFile covers the statuses, counts, renames and binary
files the inventory has to report; TestRequestFilesListsEveryChangedFile is the
regression for the tree that lost its files, and the commit page test now
asserts the end of a large patch instead of its cut.

server/web/request_runs.go +1−3

@@ -46,11 +46,9 @@ func (w *Web) RequestRuns(rw http.ResponseWriter, r *http.Request) {
46 46 w.Logger("request runs %s: %v", req.ID, err)
47 47 }
48 48 }
49 files, _, alreadyMerged := w.requestDiff(m, req)
50
51 49 w.render(rw, "request_runs", requestRunsView{
52 50 requestSidebarView: w.requestSidebar(r, m, req, m.Name+" · "+req.Title+" · runs", "").
53 withLanding(w.landingFrom(m, req, files, alreadyMerged)),
51 withLanding(w.landingFrom(m, req, w.reviewDiff(m, req))),
54 52 Tab: "runs",
55 53 Runs: results,
56 54 }, 0)