AgeCommit message (Collapse)AuthorLines
Report a max-stats value that names no periodBryce Kwon-2/+27
A value cgit does not know as a period turns the statistics page off, so a typo such as "decade" read the same as leaving stats off on purpose. The empty value stays quiet because a cached repolist writes it for a repository that turned stats off.
Hold the mailmap to max-blob-sizeBryce Kwon-1/+11
git's read_mailmap_blob inflates the whole blob, so a pusher could make every page of a repository read as much as they liked. git reads a note and the .gitmodules file whole as well, and capping those would mean bounding the lookups where the log, commit and tree pages make them, so the manual names them instead. Nothing tested that mailmap.file and mailmap.blob are ignored either.
Keep a followed diff to the path it namesBryce Kwon-2/+13
A followed diff kept every path that started with the requested one, so following small.c took small.cpp in as well. A path now has to be the requested one or lie below it, as the pathspec of an unfollowed diff matches.
Name the followed path in the diffstat headerBryce Kwon-4/+8
With follow set the diff runs over the whole commit and show_filepair applies the path, so the header read (limited to '') whether or not a path was given.
Pin the listing's blame link for a late NULBryce Kwon-0/+4
The listing judges binary by the first 8000 bytes, as git does, while the blame page and the file view look for a NUL anywhere, since one past that window would end a Lua filter's output early. The listing keeps the cheap sniff, because the whole-blob check would inflate every blob it names, so a file whose NUL lies past the window gets a blame link that ends on "Blob is binary". The test pins that trade, so a change to either side has to face it.
Let a keyboard scroll the stats tableBryce Kwon-1/+4
It scrolls sideways like the hex dump, with nothing inside a keyboard can reach, so it takes focus and the shared focus ring the same way.
Name a pinned commit with the page in the titleBryce Kwon-3/+28
Let a keyboard scroll the hex dumpBryce Kwon-1/+3
Chrome and Firefox already let an overflowing box take focus, with their own ring, but WebKit does not. The table takes focus on a mouse click as well, where focus-visible keeps the ring off.
Read the file and diff tables as layoutBryce Kwon-2/+2
The file view's table only sets the line numbers beside the code, and the unified diff's is a single cell holding every file.
Say which index column is sortedBryce Kwon-1/+6
Put a Lua filter's print output where it runsBryce Kwon-0/+31
LuaJIT and Lua 5.1 leave print's line in stdio's buffer until cgit exits, after the end of the page.
Report a snapshot format name that matches nothingBryce Kwon-1/+15
Let cgit.conf set Git's build optionsBryce Kwon-3/+10
cgit.conf was read only after Git's Makefile, which had already settled NO_REGEX and the other options it tests as it read them, so setting one there changed nothing in Git's part of the build. The second read stays for the defaults Git assigns outright, such as CC and CFLAGS. A "+=" there now appends twice to a variable nothing resets in between, such as CGIT_CFLAGS, which only repeats the flag.
Answer an empty repository's feed with a feedBryce Kwon-1/+10
Keep a repository's own settings in a cached scanBryce Kwon-12/+33
A scanned repository is read back from the cached list under the global settings, so a setting that only differed from them by being off, or by naming the default value, came back as the global one. branch-sort was written only for age, per-path module links not at all, and a filter a repository turned off left no line behind. Writing an empty value for a filter turned off makes the list depend on whether each global filter is set, so the scan key names that too.
Keep the placeholder out of a cached scanBryce Kwon-2/+9
The cached list wrote "[no description]" like any other description, so once read back it no longer counted as the placeholder and became the meta description of every repository without one. Repositories read back from the list are also marked as having had their description file read, since the scan already did, so the index does not open those files again on every request.
Leave the scan uncached with a negative cache-sizeBryce Kwon-1/+1
The page cache counts a cache-size of 0 or less as off, but scan-path cached its list for any value other than 0, so a negative one still wrote a list into cache-root.
Keep the login page out of search indexesBryce Kwon-3/+6
Keep a protected repository's header to itselfBryce Kwon-3/+7
The login page stands in for any page of the repository, so it named the description and owner of one the visitor may not see, including one hidden from the index. The site's own description fills the line, as on the index, so the header keeps its height.
Name the logo after the siteBryce Kwon-1/+5
Head the tag table's column for what it holdsBryce Kwon-2/+4
Say when a log search matches nothingBryce Kwon-0/+5
Answer a submodule path with the submoduleBryce Kwon-14/+43
The tree page read the gitlink's commit as a blob, which outside the repository is a bad object id and inside it is the commit's raw text.
Say when nothing matches a mistyped urlBryce Kwon-1/+23
Lead an error page's title with the errorBryce Kwon-5/+8
The config error page had a title of its own, in the reverse order, and now takes the same one as any other 404, since its message already says the repository failed to open.
Keep the range in a large diff's patch linkBryce Kwon-6/+14
The link named only id, so for a diff between two commits it led to a patch of the newer one alone, and without an id it lost the branch as well and led to the default branch's tip.
Offer blame only where it worksBryce Kwon-4/+37
The blame page answers 404 for a symlink, since git blames a regular file alone, and it refuses a binary file and one past max-blob-size, yet a tree listing offered blame for all of them, and so did a symlink's own page. Each row already knows its size, and git calls a file binary by its first 8000 bytes alone, which a stream reads without inflating the rest. With blame on, a listing of 2,000 delta-packed files went from about 11 to 15 ms.
Dump only the first 64 KB of a binary fileBryce Kwon-6/+16
Blame the previous revision under its own nameBryce Kwon-4/+6
Lead a blame page's folder crumbs to the treeBryce Kwon-2/+17
Link snapshots of a slash ref by a dashed nameBryce Kwon-4/+27
The snapshot page refuses to work a revision out of a name holding a slash, since that name becomes the top directory of the archive, so every link for a ref like release/2.0 answered 404. The ref now goes in the link as the id, and the archive unpacks into the repository's own prefix, as any snapshot asked for by id does.
Show a renamed file's diff as the renameBryce Kwon-11/+116
A diff limited to the new name cannot see the old one, so the diffstat's link for a renamed file, the commit page reached from that file's log, and the file's rawdiff and patch all showed every line as added. A path the old tree lacks is now diffed across the whole commit with rename detection aimed at it alone, the way git blame looks for a rename, so it is compared with the commit's deleted files and nothing else. Doing it in cgit_diff_tree keeps the log's counts for that commit in step with the page they link to. The rawdiff and patch pages leave the diff to git's own output, so for them that search finds the old name, and both names go into the limit with rename detection on.
Say why the build leaves out Lua and what to doBryce Kwon-1/+15
A LUA_PKGCONFIG that pkg-config could not resolve, with no LUA_LIBS or LUA_CFLAGS given, still claimed to link with it and then failed on lua.h, and a build that found no pkg-config dropped Lua with no hint of why. A warning rather than an error lets the build go on, since flags supplied another way, such as CGIT_LIBS in cgit.conf, may still make it link.
Log the path of a repository that will not openBryce Kwon-0/+9
The 404 page names only the repository and nothing reached the log, so a mistyped repo.path left no trace of the path cgit had tried.
Read the description file without repo.descBryce Kwon-14/+39
Only a scanned repository fell back to its description file, so one listed in cgitrc without repo.desc showed "[no description]" however its file read. repo.desc may follow repo.path, so the file is read where a page shows the description, which also spares every other request the reads.
Report a word where cgitrc expects a numberBryce Kwon-70/+136
atoi reads "yes" or "true" as 0, so repo.hide=yes, or cgit.hide true in a scanned repository's git config, silently did nothing. The values keep that meaning, since honouring them now would hide repositories on upgrade, but each one is logged with its file and line.
Report a cgitrc or include that cannot be readBryce Kwon-6/+33
A missing or unreadable cgitrc left only "No repositories found" and an empty log, the commonest first mistake with no trace of its cause. A scanned repository's own cgitrc stays quiet, since most have none.
Keep a scan with a negative ttl for goodBryce Kwon-1/+2
"The cache" promises that a negative ttl never expires, but no age was ever below a negative cache-scan-ttl, so every request started a background rescan.
List scanned repositories in path orderBryce Kwon-4/+14
readdir hands entries back in whatever order the filesystem keeps them, so proj111 could come before proj105 and a section could start twice. section-sort is off by default to keep the order written in cgitrc, and a scan has none to keep.
Key the cached scan on every setting it usesBryce Kwon-5/+59
Two cgitrc files sharing a cache-root read one list, so strict-export and trust-scan-config set in one applied to the other, and a changed setting stayed stale until the list expired. The first request after an upgrade scans again, and the files under the old names are never read.
Log an owner lookup only when it failsBryce Kwon-2/+6
getpwuid leaves errno alone for a uid with no passwd entry, so a scan logged "Unable to read the owner" with "Success" as the reason for each repository such a uid owns.
Reset the repository title before reusing itBryce Kwon-1/+3
Release only finished walks, never cgit's mailmapBryce Kwon-4/+4
release_revisions frees revs->mailmap, and the log page points it at the static list cgit_mailmap returns, so every log of a repository with enable-mailmap aborted. A walk whose setup failed holds commits that are already freed, so releasing it could free them twice.
Find Lua under the BSDs' package namesBryce Kwon-1/+4
Keep the repository title in one static bufferBryce Kwon-2/+6
Free the revision walks' arguments and stateBryce Kwon-6/+13
Spell non-zero the way the rest of the tree doesBryce Kwon-1/+1
Drop a query value check that cannot fireBryce Kwon-3/+0
Check a ref path without copying itBryce Kwon-10/+4
Share one lock-file helper between the cachesBryce Kwon-64/+58