AgeCommit message (Collapse)AuthorLines
Fade colour changes and the line highlight inBryce Kwon-0/+20
The fades are skipped for anyone who asks for reduced motion.
Brighten the logo in dark modeBryce Kwon-0/+6
Its dark red barely stood out from the dark background.
Run the blob and blame tables across the pageBryce Kwon-2/+2
A short file left the rule above the code, and the highlight bar under a fragment, only as wide as its longest line.
Let a commit's labels wrap apart from its subjectBryce Kwon-6/+19
The labels sat flush against the subject's last word, which made the two one unbreakable run, so a narrow cell stranded a word on its own line. A space now precedes each label and carries its gap, and a line that breaks there drops it, so a wrapped label starts flush.
Drop the comments from the stylesheetBryce Kwon-11/+0
Give every summary section the same columnsBryce Kwon-45/+172
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.
Drop the diffstat modes on phonesBryce Kwon-0/+4
The modes took a third of a phone's width, so longer paths broke at a hyphen or a slash. The tree listing already drops its mode column at that width, and the diff itself still names a mode that changed.
Pad the inside of the diffstat boxBryce Kwon-0/+3
The modes in the first column sat against the box's left border. A table with collapsed borders ignores its own padding, so the box now keeps its borders separate to take some.
Draw the diffstat bars as SVGBryce Kwon-28/+21
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/+30
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.
Stack the commit details on narrow screensBryce Kwon-8/+23
Below 900 pixels the name, address and date of an author or committer shared one row with the diff options beside it, so each wrapped into a sliver and the name dropped below its label. Each value now stacks under its label at those widths.
Keep the tabs on one rowBryce Kwon-6/+76
A window too narrow for the tabs wrapped the last of them onto a second row, held apart from the line under the others, as an iPhone showed on every repository page. The row now scrolls sideways instead, keeping the active tab in view and fading the side that hides more of them, and the tabs draw closer as the window narrows so all seven still fit at 360 pixels.
Release v2.9.1 v2.9.1Bryce Kwon-1/+40
Sign patches with the cgit versionBryce Kwon-6/+20
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-3/+15
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.
Keep the line highlight over the lines it namesBryce Kwon-4/+15
The bar was measured from the table's border edge, a pixel above where its offset counts from, and covered only the digits of each number. Its width was the part of the table in view, so scrolling a long line sideways left the highlight behind.
Escape the same characters in the highlighterBryce Kwon-6/+87
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-10/+179
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/+17
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.
Release v2.9.0 v2.9.0Bryce Kwon-1/+114
Update the bundled Git to 2.56.0Bryce Kwon-2/+2
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-6/+9
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.
Sort an empty list without handing qsort a nullBryce Kwon-9/+21
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.
Lock a cache slot with flockBryce Kwon-7/+44
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-2/+20
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/+26
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/+18
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.
Widen the cache ttl before multiplying itBryce Kwon-1/+3
A ttl in the tens of millions of minutes overflowed the int it was multiplied in.
Hold a scanned defbranch to a ref nameBryce Kwon-1/+14
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-1/+32
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/+23
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-31/+65
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-4/+56
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-5/+62
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/+16
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-21/+30
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.
Compress xz snapshots on one threadBryce Kwon-1/+2
Current xz uses a thread per core unless told otherwise, so a single tar.xz request could keep every core busy, unlike the other compressors.
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: 2.1 s for one of 40000 lines, now 38 ms. Git leaves it off by default as well.
Search the log literally as intendedBryce Kwon-6/+13
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-1/+17
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/+16
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-1/+29
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-3/+30
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-2/+28
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-1/+30
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-3/+31
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-5/+23
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/+17
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.