AgeCommit message (Collapse)AuthorLines
Show a renamed file's diff as the renameBryce Kwon-7/+72
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.
Read the description file without repo.descBryce Kwon-0/+21
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.
Key the cached scan on every setting it usesBryce Kwon-0/+2
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.
Order shared.c the way shared.h declares itBryce Kwon-133/+131
The header's blob and pathspec checks move after the diff wrappers so each group reads as one, and each static helper now sits directly above its only user.
Free commit and tag records beside their parsersBryce Kwon-24/+0
With the frees gone from shared.h, five page files need nothing else from it, so they stop including it.
Keep the cache's trailing slash helper in cache.cBryce Kwon-6/+0
Move cgit.c's own helpers out of shared.cBryce Kwon-68/+0
Move the mimetype lookup into ui-plain.cBryce Kwon-49/+0
Move the ref list code into ui-refs.cBryce Kwon-58/+0
Move the die wrappers into filter.cBryce Kwon-21/+0
Build a literal pathspec in one placeBryce Kwon-8/+10
Git's pathspec item holds a const string now, so a path needs no writable copy to be matched.
Keep a commit's encoding local to its parserBryce Kwon-1/+0
Drop cgit_read_first_line's unread size outputBryce Kwon-4/+2
Declare the repository variables' struct in placeBryce Kwon-6/+4
Build cgit_ensure_end's copy in one expressionBryce Kwon-9/+1
Leave the zeroed repository fields to the memsetBryce Kwon-3/+0
Grow the repository and ref lists with ALLOC_GROWBryce Kwon-24/+6
Join a diff line's pieces within one callBryce Kwon-32/+8
Xdiff hands out_line a whole line each time, as the prefix, the record and any no-newline marker, and the fragment was already flushed before the call returned, so nothing ever carried over to the next call.
Cut two comments that repeat the header or a nameBryce Kwon-5/+3
Pass over a notes ref that names no treeBryce Kwon-0/+9
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.
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. Such a file of 40,000 lines took 2.1 s and now takes 38 ms. Git leaves it off by default as well.
Hold object sizes in size_t as git 2.55 doesBryce Kwon-4/+4
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.
Share the max-blob-size check and its refusalBryce Kwon-3/+6
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-1/+1
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-4/+4
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-1/+1
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.
Skip an indented comment in the mimetype fileBryce Kwon-3/+1
Only a hash in the first column marked a comment, so an indented one was read as the type "#" for every word after it. The manual already describes comments by their first non-blank character.
Keep date-format=local-local from failing pagesBryce Kwon-1/+8
The guard took local as a name that may carry the -local suffix, but git reads local only as a whole alias of default-local and dies on anything after it, so that one value turned every page into a 500.
Gate a readme ending in a colon like a disk pathBryce Kwon-0/+7
trust-scan-config passed any readme holding a colon as a tracked file, while the parser takes one only when a path follows the colon, so a scanned repository could still name a file on disk outside itself.
Keep a repository with an empty url ignoredBryce Kwon-1/+0
The field resets at the end of cgit_add_repo cleared the ignore flag that the empty url branch had just set, so such a repository was listed on the index and selectable with ?r=, where every link to it read the byte before its url.
Replace the stray bytes of text that is not UTF-8Bryce Kwon-0/+49
A commit whose encoding header names something iconv cannot convert, or whose text is labelled UTF-8 without being it, reached a page declared UTF-8 with its bytes untouched. The atom feed already replaced them, so its UTF-8 reader moves to shared.c and every ident, subject, message and tag text passes through it.
Limit rawdiff to the requested pathBryce Kwon-11/+16
The diff and patch pages honour the path in the url, which the parameter table documents for every page, but rawdiff never handed it to git and answered with the whole diff.
Rename enable-trailers to enable-commit-trailersBryce Kwon-1/+1
Harden the request path, scan and error recoveryBryce Kwon-26/+79
Apply the mailmap at HEAD to every identBryce Kwon-0/+1
Split trailers out of the commit messageBryce Kwon-0/+2
Clean up the whole treeBryce Kwon-30/+17
Trim the comments and dead code across the treeBryce Kwon-15/+9
Rename the inconsistent config keysBryce Kwon-1/+1
The old spellings are no longer read. enable-header and enable-plain-email take the opposite value of the noheader and noplainemail they replace.
Fold enable-stats back into max-statsBryce Kwon-1/+0
A max-stats period enables the page again, as it did before v2.2.0, so one key does both jobs.
Resolve submodule links from .gitmodulesBryce Kwon-0/+1
Log scan lock failures that are not contentionBryce Kwon-2/+3
Remove the repository homepage featureBryce Kwon-1/+0
Restyle the sources and fix the audit's findingsBryce Kwon-317/+303
Settle the names, types and layout of the sourcesBryce Kwon-34/+36
Add enable-relative-dates and date-formatBryce Kwon-0/+33
Cap diff blobs by max-blob-sizeBryce Kwon-3/+22
The diff family inflated a blob of any size just to render it. A file over the limit is reported as binary instead.
Skip a ref whose object cannot be parsedBryce Kwon-1/+7
A dangling or unreadable ref was described through a null object.
Gate the stats page and add a language breakdownBryce Kwon-0/+1
The max-stats setting now only bounds the selectable periods and no longer doubles as the enable switch. The tree walk runs before the history walk on purpose. Releasing commit memory while walking history resets each commit slab index, and a commit graph lookup afterwards would read another commit slot and walk the wrong tree. The stats fixture writes a commit graph so the tests cover that path. The history walk bounds the window in process rather than passing a formatted since date to setup_revisions, and parses each commit once.
Remove the owner filter hookBryce Kwon-1/+0