A big .log or .txt opens its last lines
A .log or .txt file over 5 MB is too large to draw whole. Its page opens the
last 1,000 lines instead, under one sentence: Showing the last 1,000 of about
80,000 lines; the earlier lines are left out. A Jump to end link (an
anchor, no script) goes to the last line, and Download gives the whole file.
The count is an estimate from the size and the lines seen.
The rows carry no line numbers: the page knows the lines are the last ones, not which numbers they are, and a wrong number in a link is worse than none.
Only .log and .txt names tail. A log is read from its end; .md, .json
and source are read from the top, so a cut of their end says little. They keep
the "Too large to render" note and a download.
How it is read, and what it costs
Git stores a blob whole and has no byte range, so the file is streamed past a 512 KB buffer (memory stays that small) and the front is dropped. That takes time in proportion to the size, about 0.3 s for 32 MB on the forge's machine. So:
- the tail is kept by blob id (an id names its bytes forever, so a hit is never
stale); a second open is a few milliseconds;
- at most two scans run at once; the rest wait;
- over 32 MB the file is not scanned and reads "Too large to render";
- a stream whose length is not the file's size gives no tail.
The partial first line is dropped, so a cut never garbles a character.
Where it does not apply
- A mirror browsed on
/origins, where the file is not in a local repository,
has no tail: it reads "Too large to render" as before.
- The terminal's file view shows the same sentence and lines, with the download
address on the line below.