AgeCommit message (Collapse)AuthorLines
Drop only the cache a push makes staleBryce Kwon-17/+91
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.
Render the man pages that generators writeBryce Kwon-4/+110
DocBook, pod2man and hand written pages leaked roff onto the page: font escapes inside no fill blocks, comments, layout escapes such as \% and \c, the colours and half line moves around DocBook's links, and the requests and macro definitions their preambles open with. Those now draw nothing, the common named characters and strings render, .EX and pod2man's .Vb read as code, a .TP tag takes a line of its own and the alternating font macros switch fonts between their arguments. Anything rarer still falls back to its text.
Render more of the markdown seen in readmesBryce Kwon-0/+26
A line of equals signs or dashes under a paragraph now makes a heading of it, as on GitHub, instead of running into its text, and any other rule ends the paragraph. Four spaces or a tab start a code block, and an escaped pipe stays in its table cell. A link opening with two slashes or backslashes in any mix leads to another site, so it renders as text like the plain scheme relative one already did.
Keep a readme whole past a NUL byteBryce Kwon-6/+5
cgit takes filter output through a C string sink that stops at the first NUL, so a readme holding one lost everything after it. Each NUL now shows as U+FFFD, as a browser would show it.
Offer no diff options on an octopus mergeBryce Kwon-0/+12
The commit page draws no diff for a merge of three or more parents, so the options above it changed nothing.
Offer the versions as an optionBryce Kwon-4/+36
enable-version-info brings back the cgit and git versions that 3a00e19 took off the footer and the generator tag, for a site that wants them, and the version 2a6726a put on the signature of patches now follows it too. It stays off by default for the reason 3a00e19 gave.
Name the page first in every titleBryce Kwon-0/+20
Summary, about, log, refs, tag and stats pages shared one title, so tabs, history and search results could not tell them apart. Titles now read page, repository and site, with root-title as the site, and the description stays in the meta description, where search engines read it.
Name the graph and links header cellsBryce Kwon-1/+5
Both were empty, so a screen reader moving through the table announced those columns with no name. An aria-label names them without adding text to the page.
Load the scripts with deferBryce Kwon-0/+5
A plain script in the head held up parsing until it had downloaded and run, though cgit.js only acts once the document is ready. Deferred scripts still run in the order given and before DOMContentLoaded, so a site script after cgit.js can still call window.cgit.
Tidy the diff and stat options panelBryce Kwon-2/+2
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.
Test that every copy of the background matchesBryce Kwon-0/+16
Stop folding a tag's signature awayBryce Kwon-29/+4
The fold put a click between the reader and the signature, and the browser's own disclosure marker and summary did not take the theme. The signature prints as part of the message again, as it did up to v2.9.1.
Draw no diffstat table for a change to no filesBryce Kwon-0/+10
The padding the table gained left an empty commit with a hollow frame where the file rows would be.
Fold a tag's signature away under its messageBryce Kwon-0/+52
The armour ran on for more lines than most tag messages, as part of the message itself. git finds the signature for every kind it can sign with, so PGP, SSH and X.509 all fold the same way.
Say when a login fails, and line up the formBryce Kwon-1/+11
A wrong password sent the reader back to the same empty form, which looked no different from a crash. The redirect now carries a flag the form reads, the same for an unknown user as for a wrong password, and the form leaves the flag out of the way back it signs.
Colour css properties and pseudo-classesBryce Kwon-16/+21
Scintillua's css lexer tags them with names the map had no row for, so they came out as plain text.
Give every summary section the same columnsBryce Kwon-0/+77
The ref rows always spanned five columns and the log three to five, so with the default config the log and clone rows stopped 160px short of the table's edge, and with any config the log rows did on a phone, where they alone lost their counts. A column no cell began in also made the summary and refs pages invalid HTML.
Draw the diffstat bars as SVGBryce Kwon-0/+6
The bars were cells spanning up to 1000 columns of a nested table, which kept them free of inline styles under a strict CSP but broke the HTML table model, 18 errors on a commit page, and left Firefox's longest bar short of the full width. An SVG canvas sized by its attributes is just as safe under a CSP, validates, and draws every bar exactly to scale.
Keep each snapshot link in one pieceBryce Kwon-0/+22
On a narrow screen the download column broke a snapshot name at a hyphen or left its signature link alone on the next line. Each file and its signature now stay together, and a line breaks only between them.
Sign patches with the cgit versionBryce Kwon-3/+7
git format-patch ends each patch with the version of git that wrote it, and the bare "cgit" that 3a00e19 left in its place said less. The version is written as git writes its own, without the v of the tag, so a release build signs with "cgit 2.9.0". The footer and the generator tag still leave versions out.
Set every monospace element in the theme fontBryce Kwon-0/+8
Only some pre elements named --font-mono, so code in a readme took the browser's own font, Courier in Chrome and Safari, rather than a theme's.
Escape the same characters in the highlighterBryce Kwon-0/+40
A lexer may hand back the bytes of one separator, or the CR and LF of a line ending, in different tokens, so line endings become line feeds before lexing and the separators are escaped once the tokens are joined.
Show characters a browser breaks at as escapesBryce Kwon-4/+62
The HTML parser turns a carriage return with no line feed after it into a line feed, and WebKit starts a new line at U+2028 and U+2029, while git and the line numbers count line feeds alone, so each one set every later line of the tree and blame pages a line below its number. CSS Text makes vertical tab, form feed and next line forced breaks as well, though no engine honours that yet. The escapes follow gitweb, which shows control characters the same way.
Keep the code in step with its line numbersBryce Kwon-0/+9
The stylesheet overhaul in 4ce57f5 gave the pre of the tree and blame pages the site's monospace font but left the code element inside it on the browser's own, Courier in Safari and DejaVu Sans Mono on a typical Linux desktop. A line box holds both fonts on one baseline, so where their ascent and descent differ each code line comes out a little taller than its number. By the end of a 2,000 line file the code sat 45 lines low in Safari and 109 in all three engines on Debian.
Give the trim timing check room for a slow hostBryce Kwon-2/+3
The about-render unit test bounds three renders at one second to catch the cubic trim coming back. They take 0.1 s natively and three seconds on an emulated x86_64 host, where the check failed, while the old code took minutes, so ten seconds still tells the two apart.
Isolate git from HOME before git's own setupBryce Kwon-3/+4
Git reads the global config for its trace settings before cmd_main is reached, so the isolation there came too late and every request probed $HOME/.gitconfig. The home-access test had passed on arm64 only because access is no syscall of its own there, so it now traces every call that takes a path.
Lock a cache slot with flockBryce Kwon-0/+38
The slot lock was a POSIX record lock, which a process loses the moment any descriptor on the file closes, and the fill puts the lock file on stdout, which every exec filter and snapshot compressor closes with its dup2. A second request on the slot could then rebuild it under the first and splice the two pages. An flock holds until the last descriptor goes.
Abandon a fill whose last flush fails to writeBryce Kwon-0/+16
The slot being filled was forgotten before the page's final flush, so a write that failed there, on a full disk for one, could not abandon the fill: cgit died into the lock file instead and the visitor got nothing. The mid-page path already delivered the page from the lock file.
Hold patch and rawdiff to max-blob-sizeBryce Kwon-0/+18
Both pages hand the diff to git, whose own limit on an inlined blob is 512 MB, so a commit adding a blob the other views refuse was inflated and diffed in full. The cap is passed through to git, which shows such a blob as binary.
Keep every control byte out of a header valueBryce Kwon-0/+14
A quoted header value escaped only the quote, the backslash, CR and LF. A web server refuses a response whose header holds any other control byte, so a file named with one could not be downloaded at all.
Hold a scanned defbranch to a ref nameBryce Kwon-0/+11
The index stats the default branch below the repository to date it, and a scanned repository sets its own defbranch, which was not held to what a ref may hold, so one spelled as a path reached a file outside.
Answer the plain view once for duplicate entriesBryce Kwon-0/+25
A tree can hold two entries of one name when fsck is off, and the walk went on after the first answered: a second file put two responses in one body, and a directory under the same name printed headers from the mimetype string the first had already freed.
Hold a signature download to max-blob-sizeBryce Kwon-0/+12
A signature is a note a pusher stored, and the download read it whole without the size check every other blob a page inflates goes through.
Lead a snapshot name to its tag ahead of a branchBryce Kwon-0/+9
The refs listing offers a tag's snapshot under the stem of its name, and the lookup back from that name settled on whatever ref matched first, so a branch spelled like the stem was archived in the tag's place. Every candidate is now tried as a tag before any is tried as a branch.
Pass over a notes ref that names no treeBryce Kwon-0/+20
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. Such a ref now counts as absent.
Show an odd pushed date rather than die on itBryce Kwon-0/+39
A date past what the system holds, a zone that is no hhmm offset, or a date earlier than its own westward offset all made git die inside show_date, which took the summary, refs, log, commit and feed pages of the repository down. They are now clamped as git's own log clamps them.
Check the id before the page chrome resolves itBryce Kwon-0/+12
The chrome renders on an error page too, where the id had just been refused for using the wider revision syntax, and then looked it up anyway. A :/pattern id walks the whole history for a match.
Serve only the files a dumb clone asks forBryce Kwon-5/+9
The object path check let any run of safe characters through, so a spelling such as info//alternates or info/./alternates reached the alternates file the exact name was refused for. Only a loose object, a pack with its index and info/http-alternates are served now, and any other path is not found.
Search the log literally as intendedBryce Kwon-0/+9
setup_revisions compiles the pattern itself, and the literal type cgit set afterwards came too late, so text that was no valid regular expression, such as an unbalanced bracket, ended in a 500.
Test the features the suite never reachedBryce Kwon-0/+75
Index sorting, the commit graph, the stats periods past a week, the hex dump of a binary file and a Lua filter's html_url_arg and html_include ran in no test.
Run a config comment to the end of its lineBryce Kwon-0/+16
skip_line stopped at a NUL as well as at a newline, so the rest of the comment after one was read as a setting.
Give a repository without a path no ageBryce Kwon-0/+10
The index built its paths from a NULL repo.path, which the C library prints as "(null)", so it looked for refs under that name in the working directory.
End a long directory chain on its last linkBryce Kwon-0/+27
Past fifteen single directories the row stopped after writing the next separator, which left it ending in a dangling " / ".
Show an absolute link target as textBryce Kwon-0/+26
A symlink to /etc/passwd was resolved against the tree and linked to etc/passwd inside it, a different file or none at all.
Find a compressor on the default path when unsetBryce Kwon-0/+14
With no PATH in the environment, the check that a compressor exists gave up and refused every compressed snapshot, though execvp would have found it on the system's default path.
Keep snapshot members from starting at a slashBryce Kwon-0/+21
A name that was all suffix, such as .tar, settled on a ref called v with an empty prefix, and an empty snapshot-prefix did the same for a snapshot asked for by id, so every member of the archive started at /.
Say why an oversized readme leaves about emptyBryce Kwon-0/+15
A readme past max-blob-size is never read, which left the about page with an empty block and no word of why.
Offer tag snapshots only for a tagged commitBryce Kwon-0/+14
The tag page offered a download for a tag of a tree or a blob, which only led to a "Not a commit" page. The refs listing already checks.
Refuse pathspec magic in the feed as in the logBryce Kwon-0/+9
A feed path starting with a colon reached git as pathspec magic, so an unknown magic word ended the request in a 500 and a known one changed what the path matched, while the log answers both with a 400.
Date a reftable repository on the indexBryce Kwon-0/+5
The idle column falls back on the mtime of the branch's loose ref or of packed-refs, and a reftable repository has neither, so its cell stayed empty. Git rewrites reftable/tables.list on every ref update.