AgeCommit message (Collapse)AuthorLines
Bound the search and cache key a request can askBryce Kwon-0/+40
Gather page output into one bufferBryce Kwon-0/+65
Emit generated runs in batches, not a write eachBryce Kwon-0/+53
Fix hunk numbering and a leak in the ssdiff viewBryce Kwon-0/+35
A hunk header that states no length was numbered from the wrong line, and the line a deferred row copied was never freed.
Sort refs by the date the ref actually carriesBryce Kwon-0/+57
Expand `module-link` placeholders outside printfBryce Kwon-0/+71
Add `enable-relative-dates` and `date-format`Bryce Kwon-0/+91
Mark the security test executableBryce Kwon-0/+0
Drop the help tab and its built-in guideBryce Kwon-25/+0
Reorganize the tree into vendor/ and custom/Bryce Kwon-8/+8
Replace the browser markdown renderer with a filterBryce Kwon-2/+2
The readme is now escaped plain text unless `about-filter` points at the new `about-render.lua`, which renders markdown, man pages and plain text server-side. `enable-markdown` goes away with the renderer.
Add `max-patch-count` to bound the patch viewBryce Kwon-0/+13
Backfill an absent commit messageBryce Kwon-0/+22
Cap diff blobs by `max-blob-size`Bryce Kwon-0/+26
The diff family inflated a blob of any size just to render it. A file over the limit is reported as binary instead.
Percent-encode file paths in side-by-side diffsBryce Kwon-0/+26
Bound syntax-highlight memory and widen coverageBryce Kwon-0/+5
Reorganize and simplify the MakefileBryce Kwon-2/+2
Make the clean targets remove real test outputBryce Kwon-2/+2
Gate the stats page and add a language breakdownBryce Kwon-0/+81
`max-stats` only bounds the selectable periods now 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.
Move syntax highlighting to a Lua source filterBryce Kwon-0/+18
Stat oversized diffs instead of inlining themBryce Kwon-3/+42
Cap and paginate the ref listingsBryce Kwon-0/+60
Add a help page with common workflowsBryce Kwon-0/+25
Keep line structure in plaintext readmesBryce Kwon-0/+4
Submit option forms without inline handlersBryce Kwon-0/+10
Add security and fork-behaviour regression testsv2.0.0Bryce Kwon-0/+113
Rebuild the page chrome as semantic HTMLBryce Kwon-2/+13
The masthead, tab bar, breadcrumb, content region and footer were HTML tables, which cannot reflow and forced the page to scroll sideways on small screens. Class and id names are kept so custom themes keep matching, the tabs gain title hints and the form controls accessible names.
Gate the cache listing behind `enable-cache-list`Bryce Kwon-0/+1
The `ls_cache` page printed the cache directory path and the urls other visitors had requested, with no gate at all.
Reorganize into source, assets and librariesBryce Kwon-11/+11
The C sources move to source/, the served files to assets/, the bundled Git submodule to libraries/git and the filter scripts to extensions/. Everything the build generates now lands in build/, so a clean is a single remove and the tree stays clean.
tests: t0107: support older and/or non-GNU tarTodd Zullinger-4/+4
The untar tests for various compression algorithms use shortcut options from GNU tar to handle decompression. These options may not be provided by non-GNU tar nor even by slightly older GNU tar versions which ship on many systems. An example of the latter case is the --zstd option. This was added in GNU tar-1.32 (2019-02-23)¹. This version of tar is not provided by CentOS/RHEL, in particular. In Debian, --zstd has been backported to the tar-1.30 release. Avoid the requirement on any specific implementations or versions of tar by piping decompressed output to tar. This is compatible with older GNU tar releases as well as tar implementations from other vendors. (It may also be a slight benefit that this more closely matches what the snapshot creation code does.) ¹ Technically, the --zstd option was first released in tar-1.31 (2019-01-02), but this release was very short-lived and is no longer listed on the GNU Tar release page. Signed-off-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
tests: try with commit-graphChristian Hesse-4/+8
Git 2.24.0 enabled commit-graph by default and caused crashes without necessary update. Let's test to work with commit-graph. Signed-off-by: Christian Hesse <mail@eworm.de>
tests: do not copy snapshots to /tmp/Christian Hesse-6/+3
No idea why this was added... Possibly to inspect the snapshot manually? Let's drop it. Signed-off-by: Christian Hesse <mail@eworm.de>
global: replace hard coded hash lengthChristian Hesse-1/+1
With sha1 we had a guaranteed length of 40 hex chars. This changes now that we have to support sha256 with 64 hex chars... Support both. Signed-off-by: Christian Hesse <mail@eworm.de>
global: replace references to 'sha1' with 'oid'Christian Hesse-2/+2
For some time now sha1 is considered broken and upstream is working to replace it with sha256. Replace all references to 'sha1' with 'oid', just as upstream does. Signed-off-by: Christian Hesse <mail@eworm.de>
git: update to v2.29.0Christian Hesse-1/+1
Update to git version v2.29.0, this requires changes for these upstream commits: * dbbcd44fb47347a3fdbee88ea21805b7f4ac0b98 strvec: rename files from argv-array to strvec * 873cd28a8b17ff21908c78c7929a7615f8c94992 argv-array: rename to strvec * d70a9eb611a9d242c1d26847d223b8677609305b strvec: rename struct fields * 6a67c759489e1025665adf78326e9e0d0981bab5 test-lib-functions: restrict test_must_fail usage Signed-off-by: Christian Hesse <mail@eworm.de>
ui-snapshot: add support for zstd compressionChristian Hesse-1/+43
This patch adds support for zstd [0] compressed snapshots (*.tar.zst). We enable multiple working threads (-T0), but keep default compression level. The latter can be influenced by environment variable. [0] https://www.zstd.net/ Signed-off-by: Christian Hesse <mail@eworm.de>
tests: add tests for xz compressed snapshotsChristian Hesse-1/+43
Signed-off-by: Christian Hesse <mail@eworm.de>
ui-snapshot: add support for lzip compressionHanspeter Portner-1/+43
This patch adds support for lzip [1] compressed snapshots (*.tar.lz) [1] https://www.nongnu.org/lzip/ Signed-off-by: Hanspeter Portner <dev@open-music-kontrollers.ch> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
tests: allow to skip git version testsChristian Hesse-0/+4
This allows to run tests non-tagged git checkout or when bisecting. Signed-off-by: Christian Hesse <mail@eworm.de>
tests: skip tests if strace is not functionalChristian Hesse-0/+6
Chances are that strace is available but not functional due to restricted permissions: strace: test_ptrace_get_syscall_info: PTRACE_TRACEME: Operation not permitted strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted +++ exited with 1 +++ Just skip the tests then. Signed-off-by: Christian Hesse <mail@eworm.de>
tests: successfully validate rc versionsChristian Hesse-1/+1
For testing versions the version string differs for git tag (v2.22.0-rc3) and tarball file name (2.22.0.rc3). Let's fix validation for testing versions. Signed-off-by: Christian Hesse <mail@eworm.de>
global: spelling fixesVille Skyttä-5/+5
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
tests: allow shell to be overriddenJohn Keeping-1/+5
On some systems (e.g. Solaris), /bin/sh is not a POSIX shell. Git already provides suitable overrides in its config.mak.uname file and we provide cgit.conf to allow the user to further change this. The code for this is taken from Git's t/Makefile, meaning that we now invoke the tests in the same way that Git does. Signed-off-by: John Keeping <john@keeping.me.uk>
t0110: Chain together using &&Jason A. Donenfeld-8/+8
ui-patch: match git-format-patch(1) outputJohn Keeping-2/+2
Using (DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH) causes Git to emit a "---" line between the commit message and the body of the patch, which fixes a regression introduced in commit 455b598 (ui-patch.c: Use log_tree_commit() to generate diffs, 2013-08-20), prior to which we inserted the "---" line ourselves. DIFF_FORMAT_SUMMARY is added so that we match the output of git-format-patch(1) without the "-p" option. Signed-off-by: John Keeping <john@keeping.me.uk>
t0108: modernize styleJohn Keeping-10/+10
* &&-chaining * use test_cmp instead of cmp * use strip_headers instead of knowing how many lines there will be Signed-off-by: John Keeping <john@keeping.me.uk>
tests: only do lua tests if lua is compiled-inJason A. Donenfeld-2/+17
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
t0111: Additions and fixesLukas Fleischer-10/+10
* Rename the capitalize-* filters to dump.* since they also dump the arguments. * Add full argument validation to the email filters. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
t0111: Add basic tests for Lua filtersLukas Fleischer-29/+56
* Validate the email filter by manipulating stdin. Additional checks for all the arguments can be added in a later patch. * Add the exec prefix to all informational messages. * Rename the filter repository to filter-exec. The Git repository itself is not renamed since it can be shared amongst all filter types. * In the filter checks, check whether all arguments are passed properly instead of validating the buffer/stdin only. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
tests/: Add t0111-filter.shLukas Fleischer-0/+57
This adds basic tests for all types of exec filters. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>