AgeCommit message (Collapse)AuthorLines
Hold a signature download to max-blob-sizeBryce Kwon-0/+11
A signature is a note a pusher stored, and the download read it whole without the size check every other blob a page inflates goes through.
Lead a snapshot name to its tag ahead of a branchBryce Kwon-31/+56
The refs listing offers a tag's snapshot under the stem of its name, and the lookup back from that name settled on whatever ref matched first, so a branch spelled like the stem was archived in the tag's place. Every candidate is now tried as a tag before any is tried as a branch.
Pass over a notes ref that names no treeBryce Kwon-4/+36
A pusher can point refs/notes/commits or a signature notes ref at any object, and git dies loading one that is no tree, which ended every page of the repository, the dumb transport included. Such a ref now counts as absent.
Show an odd pushed date rather than die on itBryce Kwon-5/+23
A date past what the system holds, a zone that is no hhmm offset, or a date earlier than its own westward offset all made git die inside show_date, which took the summary, refs, log, commit and feed pages of the repository down. They are now clamped as git's own log clamps them.
Check the id before the page chrome resolves itBryce Kwon-0/+4
The chrome renders on an error page too, where the id had just been refused for using the wider revision syntax, and then looked it up anyway. A :/pattern id walks the whole history for a match.
Serve only the files a dumb clone asks forBryce Kwon-16/+21
The object path check let any run of safe characters through, so a spelling such as info//alternates or info/./alternates reached the alternates file the exact name was refused for. Only a loose object, a pack with its index and info/http-alternates are served now, and any other path is not found.
Compress xz snapshots on one threadBryce Kwon-1/+2
Current xz uses a thread per core unless told otherwise, so a single tar.xz request could keep every core busy, unlike the other compressors.
Diff without asking xdiff for a minimal resultBryce Kwon-1/+3
XDF_NEED_MINIMAL turns off the cost limit in xdiff, so a file whose lines were reordered took time quadratic in its length: 2.1 s for one of 40000 lines, now 38 ms. Git leaves it off by default as well.
Search the log literally as intendedBryce Kwon-6/+4
setup_revisions compiles the pattern itself, and the literal type cgit set afterwards came too late, so text that was no valid regular expression, such as an unbalanced bracket, ended in a 500.
Run a config comment to the end of its lineBryce Kwon-1/+1
skip_line stopped at a NUL as well as at a newline, so the rest of the comment after one was read as a setting.
Give a repository without a path no ageBryce Kwon-0/+6
The index built its paths from a NULL repo.path, which the C library prints as "(null)", so it looked for refs under that name in the working directory.
End a long directory chain on its last linkBryce Kwon-1/+2
Past fifteen single directories the row stopped after writing the next separator, which left it ending in a dangling " / ".
Show an absolute link target as textBryce Kwon-3/+4
A symlink to /etc/passwd was resolved against the tree and linked to etc/passwd inside it, a different file or none at all.
Find a compressor on the default path when unsetBryce Kwon-2/+14
With no PATH in the environment, the check that a compressor exists gave up and refused every compressed snapshot, though execvp would have found it on the system's default path.
Keep snapshot members from starting at a slashBryce Kwon-1/+9
A name that was all suffix, such as .tar, settled on a ref called v with an empty prefix, and an empty snapshot-prefix did the same for a snapshot asked for by id, so every member of the archive started at /.
Say why an oversized readme leaves about emptyBryce Kwon-3/+16
A readme past max-blob-size is never read, which left the about page with an empty block and no word of why.
Offer tag snapshots only for a tagged commitBryce Kwon-5/+9
The tag page offered a download for a tag of a tree or a blob, which only led to a "Not a commit" page. The refs listing already checks.
Refuse pathspec magic in the feed as in the logBryce Kwon-0/+8
A feed path starting with a colon reached git as pathspec magic, so an unknown magic word ended the request in a 500 and a known one changed what the path matched, while the log answers both with a 400.
Date a reftable repository on the indexBryce Kwon-0/+10
The idle column falls back on the mtime of the branch's loose ref or of packed-refs, and a reftable repository has neither, so its cell stayed empty. Git rewrites reftable/tables.list on every ref update.
Answer dumb-clone HEAD from the ref storeBryce Kwon-5/+27
A reftable repository keeps only a placeholder in its HEAD file, so a dumb clone was told HEAD named refs/heads/.invalid and checked nothing out. HEAD is now answered the way git's http-backend answers it.
Make two branch conditions say what they rely onBryce Kwon-2/+2
cgit_parse_url tested ctx.repo where the loop sets repo_end alongside it, and the log's closing link kept a commit it never read. Clang's analyzer tripped on both.
Close the tree row when a link target is unreadableBryce Kwon-10/+14
The row stopped at the error and left its cells open, so the rest of the listing rendered inside it.
Correct three comments that drifted from the codeBryce Kwon-6/+7
Cut text between characters, never inside oneBryce Kwon-9/+10
The index description was cut at a byte count, which could split a multibyte character and leave an invalid sequence on the page. Commit subjects already backed up to the start of the character, so html_ntxt now does that for every caller.
Check cgit under sparse in its own dialectBryce Kwon-1/+3
The sparse rule put git's SPARSE_FLAGS last, and their -std=gnu99 overrode the gnu17 the sources are built as.
Drop the NO_C99_FORMAT switch nothing readsBryce Kwon-4/+0
Neither cgit nor the bundled Git reads the macro it defined.
Find libc's write when git writes firstBryce Kwon-0/+4
A Lua build replaces write, and git can write before cmd_main reaches cgit_init_filters, as it does when GIT_TRACE2 is set, which called through a null pointer and crashed every request.
Read a negative ref count as no limitBryce Kwon-5/+3
summary-branches, summary-tags and max-ref-count already listed every ref at 0, but a negative value reached qsort as a count and crashed the summary and refs pages, and emptied the branch switcher.
Page a followed log by the name asked forBryce Kwon-5/+6
Each row of a followed log moves ctx.qry.vpath to the name its commit knew the file by, and the pager built its links from that, so past a rename both links named the old file and led to an empty page.
Show the root commit in a followed logBryce Kwon-13/+12
A followed log diffs each commit against its parent to learn whether the file changed there, and a root commit was skipped rather than diffed against the empty tree, so a file created in the first commit never showed that commit.
Peel an annotated tag before looking for a readmeBryce Kwon-0/+1
Tag links carry the tag name as the head, so on any page reached from an annotated tag the about tab vanished and the about page redirected to the summary.
Encode repository urls and the feed branchBryce Kwon-25/+53
Links built from the repository url, among them the description link on the index and the Atom and refs links, wrote it as configured, so a name holding a space, '#' or '?' broke them. The feed link in the page head did the same with the branch, which turned a '+' into a space.
Hold object sizes in size_t as git 2.55 doesBryce Kwon-37/+37
Git 2.55 moved object sizes from unsigned long to size_t. The two are the same type on 64-bit hosts, but not on a 32-bit one, where GCC 14 rejects the mismatched pointers, so cgit stopped compiling there.
Name every Lua filter failure in the logBryce Kwon-9/+17
A script raising anything but a string handed die a null to print, and a Lua state that could not be created was used anyway once the filter closed.
Let a Lua script write while it loadsBryce Kwon-2/+6
A script's top level runs before cgit hooks stdout for it, and the unhook html() began with tripped an assert that aborted cgit.
Detect Lua 5.5 when buildingBryce Kwon-1/+1
cgit builds against Lua 5.5 and serves the same pages with it, but a host whose only Lua was 5.5 got a binary without Lua from the search.
Give an empty repository's clone table its hooksBryce Kwon-3/+3
It was a bare table.list with no name, section or label, the one listing that broke what the README promises a theme.
Hand the about filter the tree url its links needBryce Kwon-30/+81
With nothing below the about page, a readme's relative links have to be written against the tree, and only cgit knows how this site spells the url of a tree page and which ref the readme was read from. Both reach the filter already escaped for a url, built by the same writer as cgit's own links.
Answer 404 for any path below the about pageBryce Kwon-120/+21
The about page served every file beside the readme as a page of its own, through the about filter, and answered 200 for directories and missing files alike. Images it passed through came from the root of the default branch whatever the readme's own directory and ref. A readme on disk exposed its whole directory this way.
Indent continuation lines with one tabBryce Kwon-7/+7
Share the max-blob-size check and its refusalBryce Kwon-27/+35
Five copies of the test and four of the error page had to agree by hand. The new check pins the four refusals, which no test covered.
Mark the parameters callbacks leave unusedBryce Kwon-6/+6
With these and the two changes before them, cgit builds under git's DEVELOPER=1 settings, which also annotate their own callbacks this way.
Pass callbacks to git by addressBryce Kwon-8/+20
ISO C has no conversion between a function pointer and void *, so the callbacks handed through git's data pointers and the write found by dlsym stopped the pedantic half of a DEVELOPER=1 build.
Keep string literals behind const pointersBryce Kwon-59/+53
Git's DEVELOPER=1 build turns on -Wwrite-strings as an error, and the literals stored through plain char pointers failed cgit's own objects there. The exec filter's argv takes the cast execvp needs once, the way git's run-command does.
Remove what the version removal left behindBryce Kwon-6/+2
Stop the stats page after its error pageBryce Kwon-11/+12
A walk that failed to prepare printed an error page and then went on to print the statistics page after it, where the log and the feed return. No request reaches that failure today, since the walk is only limited by a range or an order the page never asks for.
Read and write slot keys and pages in fullBryce Kwon-3/+7
xread and xwrite may move fewer bytes than asked. A short write of the key left a slot that could never match, a short read of it reported a collision, and a page write that moved nothing looped for ever.
Stop the sendfile loop at the end of a short slotBryce Kwon-0/+4
sendfile returns zero at the end of the file, and the loop only ended once the offset reached the size recorded when the slot was opened, so a slot cut shorter in between spun the request forever. Only Linux builds this path. A stand-in header type checked it here.
Name the right file and error in the scan logsBryce Kwon-2/+3
A failed stat logged the directory rather than the entry inside it, and a project list that failed to read printed strerror of the flag ferror returns, which names an unrelated error.
Keep the charset off types that only spell xmlBryce Kwon-2/+4
Matching xml anywhere in the type also caught the Office formats, whose names hold openxmlformats, so a .docx went out with a UTF-8 charset.