AgeCommit message (Collapse)AuthorLines
Spell the signature suffix once for both filesBryce Kwon-2/+2
Open and close each page through the layout callsBryce Kwon-36/+31
Allocate formatted strings with git's xstrfmtBryce Kwon-7/+7
Keep the permission triplet beside its one callerBryce Kwon-3/+8
Keep the clone row and title docs in the headerBryce Kwon-10/+0
Keep three helpers beside their only callersBryce Kwon-62/+62
Build cgit_date_mode's result on the stackBryce Kwon-2/+1
Write the meta description in one placeBryce Kwon-6/+4
Read a title's path from the end with strrchrBryce Kwon-20/+7
Trim trailing slashes with git's strbuf helperBryce Kwon-12/+4
Build the full current url from the current urlBryce Kwon-8/+3
Fold the va_list error page into its one callerBryce Kwon-12/+4
Ask head_is_named before carrying the branchBryce Kwon-1/+1
Let self_link's fallback be a plain reporevlinkBryce Kwon-8/+2
Escape a submodule link's class like the othersBryce Kwon-6/+6
Open site and repository links through one helperBryce Kwon-24/+17
Write each query argument through one helperBryce Kwon-49/+30
Return repolink's delimiter without copying itBryce Kwon-1/+1
Drop the query-string form of every linkBryce Kwon-83/+30
cgit falls back to SCRIPT_NAME for virtual_root whenever cgitrc leaves it out, so the ?url= and ?r= forms only ever reached an error page raised while cgitrc was still being read. The page argument of cgit_add_hidden_formfields fed only the url field, so it is unused until its callers stop passing it.
Stop leaking the host on an embedded pageBryce Kwon-3/+3
Stop leaking the short hash of an object linkBryce Kwon-7/+4
Trim a snapshot name without reading out of boundsBryce Kwon-28/+10
For a url of .git, or an empty one, repo_basename stepped its index to the byte before its buffer, read it, and would have cleared it had it held a slash. Git's strbuf trims take the same steps safely, and they lift the 1024-byte cap that failed the page for a longer url.
Offer the versions as an optionBryce Kwon-1/+9
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/+10
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.
Load the scripts with deferBryce Kwon-1/+1
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.
Keep each snapshot link in one pieceBryce Kwon-0/+4
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.
Show an odd pushed date rather than die on itBryce Kwon-3/+3
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/+4
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.
Cut text between characters, never inside oneBryce Kwon-7/+1
The index description was cut at a byte count, which could split a multibyte character and leave an invalid sequence on the page. Commit subjects already backed up to the start of the character, so html_ntxt now does that for every caller.
Read a negative ref count as no limitBryce Kwon-1/+1
summary-branches, summary-tags and max-ref-count already listed every ref at 0, but a negative value reached qsort as a count and crashed the summary and refs pages, and emptied the branch switcher.
Encode repository urls and the feed branchBryce Kwon-23/+23
Links built from the repository url, among them the description link on the index and the Atom and refs links, wrote it as configured, so a name holding a space, '#' or '?' broke them. The feed link in the page head did the same with the branch, which turned a '+' into a space.
Hold object sizes in size_t as git 2.55 doesBryce Kwon-2/+2
Git 2.55 moved object sizes from unsigned long to size_t. The two are the same type on 64-bit hosts, but not on a 32-bit one, where GCC 14 rejects the mismatched pointers, so cgit stopped compiling there.
Hand the about filter the tree url its links needBryce Kwon-27/+60
With nothing below the about page, a readme's relative links have to be written against the tree, and only cgit knows how this site spells the url of a tree page and which ref the readme was read from. Both reach the filter already escaped for a url, built by the same writer as cgit's own links.
Share the max-blob-size check and its refusalBryce Kwon-0/+6
Five copies of the test and four of the error page had to agree by hand. The new check pins the four refusals, which no test covered.
Mark the parameters callbacks leave unusedBryce Kwon-1/+1
With these and the two changes before them, cgit builds under git's DEVELOPER=1 settings, which also annotate their own callbacks this way.
Keep string literals behind const pointersBryce Kwon-24/+17
Git's DEVELOPER=1 build turns on -Wwrite-strings as an error, and the literals stored through plain char pointers failed cgit's own objects there. The exec filter's argv takes the cast execvp needs once, the way git's run-command does.
Keep the charset off types that only spell xmlBryce Kwon-2/+4
Matching xml anywhere in the type also caught the Office formats, whose names hold openxmlformats, so a .docx went out with a UTF-8 charset.
Keep the version numbers off the pagesBryce Kwon-7/+3
The generator meta, the footer and the patch signature named the exact cgit and git versions on every response, which only helps someone matching a site against an advisory. The shipped server configs already hide the server's own version for the same reason, and `cgit --version` still answers on the host.
Mark a page behind an auth filter privateBryce Kwon-0/+5
Only the login page carried a Cache-Control, so a page an auth filter had let a visitor see could be kept by a cache shared with the next visitor. The page also varies on the cookie that got them in.
Send a charset only with a text typeBryce Kwon-1/+12
Archives, packs and the HEAD file went out as octet-stream or gzip with a UTF-8 charset on the end, since only the blob page cleared it. The headers now decide from the type itself, so the two places that cleared the charset by hand no longer need to.
Leave a branch spelled like an option out of the switcherBryce Kwon-0/+4
Such a name is refused as a head before git could read it as an option, and the fallback branch already skips it, so the switcher offered a choice that led only to an error page.
Keep the query string across the about redirectsBryce Kwon-6/+15
The hop to the trailing-slash form of the about page, and the hop back to the summary of a repository without a readme, were built from the path alone, so a request for the about page of another branch landed on the default one. The query goes into the Location line as the client sent it, with any byte a header cannot carry percent-encoded.
Add stable markup hooks for site themesBryce Kwon-14/+37
Align with spaces instead of tabsBryce Kwon-3/+3
Harden the page renderersBryce Kwon-65/+122
Name the tagged object under its full idBryce Kwon-5/+9
Settle the snapshot v-prefix from the tag listBryce Kwon-8/+35
`compose_snapshot_prefix` dropped the leading v of a tag only when just one of the names 1.2, v1.2 and V1.2 resolved as a tag, so that the shorter snapshot name could always be traced back to one tag. Those probes went through ref lookups, and on a case-insensitive filesystem a lookup for V1.2 finds the loose file of v1.2, so every freshly made tag counted as ambiguous and kept its v. Once git packed the refs the lookups became exact and the same tag quietly changed its snapshot names. The claimants on a stripped name are now counted over the tag list itself with exact string comparison, so the answer no longer depends on how a ref is stored or on the filesystem underneath. Two tags that really differ only by the letter's case still both keep it.
Clean up the whole treeBryce Kwon-198/+120
Trim the comments and dead code across the treeBryce Kwon-17/+19
Remove the auto-submitting selectsBryce Kwon-1/+1