AgeCommit message (Collapse)AuthorLines
Replace a read-only age file without askingBryce Kwon-1/+1
mv asks before replacing a file it cannot write when stdin is a terminal, and the age hook sends the question to /dev/null. git always gives a hook a pipe, but a hook run by hand from a terminal waited on an answer no one could see and then kept the old date.
Drop cached pages asked for with an escaped urlBryce Kwon-3/+7
README tells a visitor to write a plus in the query form as %2b, and cgit caches such a page under the raw query, but the hook compared that query with the url as it stands. A push to foo+bar.git left its pages under url=foo%2bbar.git/ and r=foo%2Bbar.git cached and stale until their ttl ran out. Decoding in sh would take more than the hook is worth, so a query with a % or a + now counts as stale, which costs another repository's page at most a refill.
Say what the age hook does with a read-only fileBryce Kwon-3/+4
The header said a file the pusher cannot write stays as it was, but the hook replaces it through mv, which needs only the directory, and with stdin not a terminal mv does so without asking. That is the useful behaviour, so the header now says so, and a test holds the hook to it. Only a directory the pusher cannot write keeps the old file, which was the one case tested.
Say to run the cache hook as the web serverBryce Kwon-4/+8
The header asked for write access for the pushing user, but MANUAL.txt keeps the cache root at mode 0700 for the web server and cgit writes its slots at 0600, so a pusher could at best drop every page rather than only its own.
Spell non-zero the way the tree doesBryce Kwon-3/+3
Point each hook at the other hooks hereBryce Kwon-3/+6
The cache hook named only the age-file hook, from before the commit-graph hook came.
Keep the age hook quiet when it cannot writeBryce Kwon-5/+7
Keep the commit-graph current in an example hookBryce Kwon-0/+34
cgit's log, blame and graph pages read commits from the commit-graph when a repository has one, and its changed path filters let a walk limited to one file skip the commits that never touched it. git gc writes a graph only now and then and starts those filters only when a write asks for them, so the hook writes a split layer with them after each push.
Drop only the cache a push makes staleBryce Kwon-11/+104
The hook cleared every slot on a push to any repository. cgit writes the request a slot answers at its head, so the hook now reads it back and drops only the pushed repository's pages and the index. It finds the repository's url from scan-path or hooks.cgiturl, and with neither it clears everything as before.
Keep the age hook's directory group writableBryce Kwon-2/+11
The hook forced a 022 umask, so in a repository shared with a group the first pusher owned info/web and every other member's push failed to write the age file there.
Keep the cache hook's rm errors from pushersBryce Kwon-4/+4
Only the exit status was hidden, so a pusher without write access to the cache root saw a permission error per cached page, against what the hook's own comment promised.
Unify the docs, samples and extensionsBryce Kwon-34/+26
Clean up the whole treeBryce Kwon-4/+2
Trim the comments and dead code across the treeBryce Kwon-4/+3
Rename the inconsistent config keysBryce Kwon-3/+3
The old spellings are no longer read. enable-header and enable-plain-email take the opposite value of the noheader and noplainemail they replace.
Drop the update-server-info hookBryce Kwon-25/+0
Rename the agefile hook to cgit-ageBryce Kwon-0/+0
Add a hook that clears cgit's cache on pushBryce Kwon-0/+38
Set a readable umask in the post-update hookBryce Kwon-0/+7
Rewrite the agefile hook for reliabilityBryce Kwon-6/+25
Reorganise the tree into vendor/ and custom/Bryce Kwon-0/+37