AgeCommit message (Collapse)AuthorLines
Free the revision walks' arguments and stateBryce Kwon-1/+3
Refuse pathspec magic through one helperBryce Kwon-5/+1
Start each history walk through one helperBryce Kwon-4/+1
Free commit and tag records beside their parsersBryce Kwon-1/+0
With the frees gone from shared.h, five page files need nothing else from it, so they stop including it.
Drop the hidden form fields' unused page argumentBryce Kwon-1/+1
Sort with git's QSORTBryce Kwon-1/+1
QSORT skips a list of fewer than two entries, so an empty list's null base never reaches qsort, which is what cgit_qsort was written for.
Tidy comments on the history pagesBryce Kwon-7/+4
Move the stats period struct into ui-stats.cBryce Kwon-6/+24
Print every stats row with one functionBryce Kwon-32/+16
The cells of the Others row lose the empty class attribute they carried.
Step a stats period with one functionBryce Kwon-47/+18
Build the patch and stats arguments in a strvecBryce Kwon-12/+7
Drop rev settings that change nothingBryce Kwon-4/+0
repo_init_revisions already sets abbrev, commit_format and show_root_diff to these values, and verbose_header is only read by log_tree_commit, which the log and stats walks never call.
Refuse pathspec magic on the stats pageBryce Kwon-0/+6
Open the stats window at midnight on its first dayBryce Kwon-0/+4
Tidy the diff and stat options panelBryce Kwon-3/+3
Its caption sat above the box, each select took its own width, and the reload button hung indented under them. The caption is now the panel's header strip, the selects and the button share one column at the width of the widest select, and the labels lose their colons to match the commit details.
Sort an empty list without handing qsort a nullBryce Kwon-1/+1
Every list sorted here is null until its first entry, and C leaves a null base undefined even with nothing to sort. glibc declares it nonnull and its UBSan build aborted the stats page of a repository with no commits in the window, which the Linux matrix caught.
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.
Add stable markup hooks for site themesBryce Kwon-13/+12
Harden the page renderersBryce Kwon-26/+30
Clean up the whole treeBryce Kwon-25/+13
Trim the comments and dead code across the treeBryce Kwon-4/+4
Remove the auto-submitting selectsBryce Kwon-3/+3
Fold `enable-stats` back into `max-stats`Bryce Kwon-4/+3
A `max-stats` period enables the page again, as it did before v2.2.0, so one key does both jobs.
Remove the language breakdown from the stats pageBryce Kwon-174/+4
Use standard HTTP reason phrasesBryce Kwon-2/+2
Null-terminate the stats pathspec argvBryce Kwon-1/+4
Tidy the structure of the generated markupBryce Kwon-9/+9
Print the language shares without the localeBryce Kwon-1/+5
Tidy the option panelsBryce Kwon-8/+8
Restyle the sources and fix the audit's findingsBryce Kwon-275/+299
Work out the stats period labels onceBryce Kwon-49/+56
Compare author totals by signBryce Kwon-1/+7
The comparator returned a long difference truncated to int, which could flip sign and leave the ordering inconsistent.
Settle the names, types and layout of the sourcesBryce Kwon-10/+11
Prune the stats walk and guard its datesBryce Kwon-1/+9
Gate the stats page and add a language breakdownBryce Kwon-18/+182
`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.
Submit option forms without inline handlersBryce Kwon-2/+2
Point the fork's links and credits at itselfBryce Kwon-1/+1
AUTHORS now records the upstream developers as the project's history rather than as maintainers of the fork.
Fix the stats year label and a missing authorBryce Kwon-2/+4
The year period rendered without its label, and a commit with no author line crashed the view.
Reorganize into source, assets and librariesBryce Kwon-0/+0
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.
git: update to v2.46.0Christian Hesse-0/+2
Update to git version v2.46.0, this requires changes for these upstream commits: * e7da9385708accf518a80a1e17969020fb361048 global: introduce `USE_THE_REPOSITORY_VARIABLE` macro * 9da95bda74cf10e1475384a71fd20914c3b99784 hash: require hash algorithm in `oidread()` and `oidclr()` * 30aaff437fddd889ba429b50b96ea4c151c502c5 refs: pass repo when peeling objects * c8f815c2083c4b340d4148a15d45c55f2fcc7d3f refs: remove functions without ref store Signed-off-by: Christian Hesse <mail@eworm.de>
ui-stats: add missing source headerChristian Hesse-0/+8
Signed-off-by: Christian Hesse <mail@eworm.de>
git: update to v2.41.0Christian Hesse-1/+1
Update to git version v2.41.0, with lots of changes... This requires changes for these upstream commits: * 60ff56f50372c1498718938ef504e744fe011ffb banned.h: mark `strtok()` and `strtok_r()` as banned * 52acddf36c8cb3778ab2098a0d95cc2e375a4069 string-list: multi-delimiter `string_list_split_in_place()` * d850b7a545fcfbd97460a921c7f7c59d933eb0f7 cocci: apply the "cache.h" part of "the_repository.pending" * cb338c23d6d518947bf6f7240bf30e2ec232bd3b cocci: apply the "commit-reach.h" part of "the_repository.pending" * ecb5091fd4301ac647db0bd2504112b38f7ee06d cocci: apply the "commit.h" part of "the_repository.pending" * 085390328f5fe1dfba67039b1fd6cc51546a4e41 cocci: apply the "diff.h" part of "the_repository.pending" * bc726bd075929aab6b3e09d4dd5c2b0726fd5350 cocci: apply the "object-store.h" part of "the_repository.pending" * bab821646a74c446370fa8d01ca851f247df5033 cocci: apply the "pretty.h" part of "the_repository.pending" * afe27c889429438829bc8818ed17e4960bd3ef02 cocci: apply the "packfile.h" part of "the_repository.pending" * 12cb1c10a64170a5d600dd1c6c8abfeec105fb6b cocci: apply the "refs.h" part of "the_repository.pending" * 035c7de9e9ea11d26df5f9e4bb117f91ed11a9fd cocci: apply the "revision.h" part of "the_repository.pending" ... and some more I missed to list 😜 - for example the move and cleanup of headers and includes (see changes in `cgit.h`) comes to mind... Signed-off-by: Christian Hesse <mail@eworm.de>
global: use release_commit_memory()John Keeping-2/+1
Instead of calling two separate Git functions to free memory associated with a commit object, use Git's wrapper which does this. This also counts as a potential future bug fix since release_commit_memory() also resets the parsed state of the commit, meaning any attempt to use it in the future will correctly fill out the fields again. release_commit_memory() does not set parents to zero, so keep that for additional safety in case CGit checks this without calling parse_commit() again. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
git: update to v2.30.0Christian Hesse-24/+24
Update to git version v2.30.0, this requires changes for these upstream commits: * 88894aaeeae92e8cb41143cc2e045f50289dc790 blame: simplify 'setup_scoreboard' interface * 1fbfdf556f2abc708183caca53ae4e2881b46ae2 banned.h: mark non-reentrant gmtime, etc as banned Signed-off-by: Christian Hesse <mail@eworm.de>
git: update to v2.21.0Christian Hesse-1/+1
Update to git version v2.21.0. Required changes follow upstream commits: * 6a7895fd8a3bd409f2b71ffc355d5142172cc2a0 (commit: prepare free_commit_buffer and release_commit_memory for any repo) * e092073d643b17c82d72cf692fbfaea9c9796f11 (tree.c: make read_tree*() take 'struct repository *') Signed-off-by: Christian Hesse <mail@eworm.de> Reviewed-by: John Keeping <john@keeping.me.uk>
forms: action should not be emptyJason A. Donenfeld-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
ui-stats: cast pointer before checking for zeroJohn Keeping-2/+2
We abuse the "void *util" field as a counter and recently started to cast it to a uintptr_t to avoid risking nasal demons by performing arithmetic on a void pointer. However, compilers are also known to do "interesting" things if they know that a pointer is or isn't NULL. Make this safer by checking if the counter (after casting) is non-zero rather than checking if the pointer is non-null. Signed-off-by: John Keeping <john@keeping.me.uk>
ui-stats: if we're going to abuse void*, do it safelyJason A. Donenfeld-10/+7
stats: move layout into page functionJohn Keeping-2/+6
This also allows us to return proper HTTP error codes for invalid requests. Signed-off-by: John Keeping <john@keeping.me.uk>
ui-stats: make cgit_period definitions 'static const'John Keeping-7/+7
These definitions should not be modified (and never are) so we can move them to .rodata. Signed-off-by: John Keeping <john@keeping.me.uk>