AgeCommit message (Collapse)AuthorLines
Add stable markup hooks for site themesBryce Kwon-7/+10
Harden the page renderersBryce Kwon-4/+7
Clean up the whole treeBryce Kwon-12/+6
Trim the comments and dead code across the treeBryce Kwon-3/+2
Use standard HTTP reason phrasesBryce Kwon-1/+1
Tidy the structure of the generated markupBryce Kwon-5/+5
Skip the owner link when a repo has no ownerBryce Kwon-7/+11
Let the listings wrap and the diff tables scrollBryce Kwon-1/+1
Restyle the sources and fix the audit's findingsBryce Kwon-159/+204
Stop the index and the log repeating workBryce Kwon-20/+35
Settle the names, types and layout of the sourcesBryce Kwon-2/+2
Remove the owner filter hookBryce Kwon-5/+1
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.
Compare repository idle times by signBryce Kwon-1/+7
The idle-sort comparator returned a 64-bit time difference truncated to int, which could flip sign and leave the ordering inconsistent.
Date repositories from HEAD and guard its branchBryce Kwon-2/+27
The index derived a repository's age from `refs/heads/master` alone, so a repository on any other default branch showed no age. HEAD is repo-controlled and the age stat walks under `refs/heads`, so a branch name carrying a parent-directory component is rejected.
Adapt the layout to small screensBryce Kwon-8/+10
On a phone the description, owner and shortcut columns crowded the index and pushed the age off screen, and tapping the name already opens the repository, so the index collapses to name and age.
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.
cgit: truncate all config values at the newlineJason A. Donenfeld-1/+1
These would be largely invalid anyway (save, I suppose, for Linux file paths that technically can contain new lines). The actual problem is that these get printed back out into cached -- and trusted -- cgitrc files, and if the fields have newlines, the git-config way of less trusted users configuring repos on a shared system can be abused to inject newlines, which then can be used to smuggle global options (including filters, which execute code) into the cached cgitrc. So now, only ever duplicate up to the newline, when dealing with these inputs. Reported-by: Adrian Denkiewicz <adrian@doyensec.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
ui-repolist,ui-shared: remove redundant title on repo anchorsChris Mayo-1/+1
The title attribute was being set to the same value as the anchor element text. Signed-off-by: Chris Mayo <aklhfex@gmail.com> Reviewed-by: Eric Wong <e@80x24.org> Reviewed-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
ui-repolist: do not return unsigned (negative) valueChristian Hesse-1/+1
The function read_agefile() returns time_t, which is a signed datatime. We should not return unsigned (negative) value here. Reported-by: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Christian Hesse <mail@eworm.de>
global: make 'char *path' const where possibleChristian Hesse-1/+1
Signed-off-by: Christian Hesse <mail@eworm.de>
global: remove functionality we deprecated for cgit v1.0Christian Hesse-3/+0
The man page states these were deprecated for v1.0. We are past v1.1, so remove the functionality. Signed-off-by: Christian Hesse <mail@eworm.de> Reviewed-by: John Keeping <john@keeping.me.uk>
html: html_ntxt with no ellipsisJeff Smith-1/+2
For implementing a ui-blame page, there is need for a function that outputs a selection from a block of text, transformed for HTML output, but with no further modifications or additions. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Reviewed-by: John Keeping <john@keeping.me.uk>
Remove unused variable from sort_section()Lukas Fleischer-1/+0
Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
ui-repolist: properly sort by ageJason A. Donenfeld-21/+17
When empty repos exist, comparing them against an existing repo with a good mtime might, with particular qsort implementations, not sort correctly, because of this brokenness: if (get_repo_modtime(r1, &t) && get_repo_modtime(r2, &t)) However, sorting by the age column works as expected, so anyway, to tidy things up, we simply reuse that function. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
css: highlight even table rows and skip empty rowsChristian Hesse-1/+1
This is stolen from kernel.org css [0]. [0] https://git.kernel.org/cgit-korg-0.10.1.css
ui-repolist: fix memory leakChristian Hesse-1/+3
ui-repolist: fix memory leakChristian Hesse-1/+4
ui: show ages in the originator's timezoneJohn Keeping-1/+1
This affects the tooltip showing the full time and the case when a date is sufficiently old to be shown in full rather than as an offset. Signed-off-by: John Keeping <john@keeping.me.uk>
ui-shared: remove "format" from cgit_print_age()John Keeping-1/+1
We never use any format other than FMT_SHORTDATE, so move that into the function. Signed-off-by: John Keeping <john@keeping.me.uk>
ui-repolist: return HTTP 404 if no repositories foundPeter Colberg-3/+17
Return HTTP status code 404 Not found when querying a non-existent repository, which signals to search engines that a repository no longer exists. Further, some webservers such as nginx permit logging requests to different files depending on the HTTP code. Signed-off-by: Peter Colberg <peter@colberg.org>
ui-repolist: extract repo visibility criteria to separate functionPeter Colberg-3/+10
Signed-off-by: Peter Colberg <peter@colberg.org>
ui-repolist: initialize char *buf to NULLChristian Hesse-1/+1
readfile() can fail if the agefile is not readable. Make sure free() does not free an ininitialized string. Signed-off-by: Christian Hesse <mail@eworm.de>
ui-repolist: fix resource leak: free allocation from cgit_currenturlChristian Hesse-1/+3
Coverity-id: 13930 Signed-off-by: Christian Hesse <mail@eworm.de>
ui-repolist: fix resource leak: free before returnChristian Hesse-1/+3
Coverity-id: 13931 Signed-off-by: Christian Hesse <mail@eworm.de>
about: move layout into page functionsJohn Keeping-1/+4
Signed-off-by: John Keeping <john@keeping.me.uk>
Remove redundant includesJohn Keeping-1/+0
These are all included in git-compat-util.h (when necessary), which we include in cgit.h. Signed-off-by: John Keeping <john@keeping.me.uk>
log: allow users to follow a fileJohn Keeping-1/+1
Teach the "log" UI to behave in the same way as "git log --follow", when given a suitable instruction by the user. The default behaviour remains to show the log without following renames, but the follow behaviour can be activated by following a link in the page header. Follow is not the default because outputting merges in follow mode is tricky ("git log --follow" will not show merges). We also disable the graph in follow mode because the commit graph is not simplified so we end up with frequent gaps in the graph and many lines that do not connect with any commits we're actually showing. We also teach the "diff" and "commit" UIs to respect the follow flag on URLs, causing the single-file version of these UIs to detect renames. This feature is needed only for commits that rename the path we're interested in. For commits before the file has been renamed (i.e. that appear later in the log list) we change the file path in the links from the log to point to the old name; this means that links to commits always limit by the path known to that commit. If we didn't do this we would need to walk down the log diff'ing every commit whenever we want to show a commit. The drawback is that the "Log" link in the top bar of such a page links to the log limited by the old name, so it will only show pre-rename commits. I consider this a reasonable trade-off since the "Back" button still works and the log matches the path displayed in the top bar. Since following renames requires running diff on every commit we consider, I've added a knob to the configuration file to globally enable/disable this feature. Note that we may consider a large number of commits the revision walking machinery no longer performs any path limitation so we have to examine every commit until we find a page full of commits that affect the target path or something related to it. Suggested-by: René Neumann <necoro@necoro.eu> Signed-off-by: John Keeping <john@keeping.me.uk>
ui-repolist: make sortcolumn definitions 'static const'John Keeping-2/+2
These are not used outside this file and are not declared; they are also never modified. Signed-off-by: John Keeping <john@keeping.me.uk>
Avoid non-ANSI function declarationsJohn Keeping-3/+3
Sparse says things like: warning: non-ANSI function declaration of function 'calc_ttl' Signed-off-by: John Keeping <john@keeping.me.uk>
Make root handling sane again.Jason A. Donenfeld-1/+1
ui-shared: Add current url helper function.Jason A. Donenfeld-2/+2
ui-repolist: use ctx.qry.url instead of rooturl, in case we're filteringJason A. Donenfeld-2/+2
ui-repolist: use correct owner query linkJason A. Donenfeld-1/+1
Add repo.hide and repo.ignoreLukas Fleischer-0/+2
These options can be used to hide a repository from the index or completely ignore a repository, respectively. They are particularly useful when used in combination with scan-path. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
repolist: add owner-filterChris Burroughs-7/+13
This allows custom links to be used for repository owners by configuring a filter to be applied in the "Owner" column in the repository list.
git: update to v2.2.1Christian Hesse-3/+4
Update to git version v2.2.1, including API changes. Signed-off-by: Christian Hesse <mail@eworm.de>
git: update for git 2.0Christian Hesse-1/+1
prefixcmp() and suffixcmp() have been remove, functionality is now provided by starts_with() and ends_with(). Retrurn values have been changed, so instead of just renaming we have to fix logic. Everything else looks just fine.
repolist: make owner clickable to searchJason A. Donenfeld-0/+6
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Switch to exclusively using global ctxLukas Fleischer-3/+3
Drop the context parameter from the following functions (and all static helpers used by them) and use the global context instead: * cgit_print_http_headers() * cgit_print_docstart() * cgit_print_pageheader() Remove context parameter from all commands Drop the context parameter from the following functions (and all static helpers used by them) and use the global context instead: * cgit_get_cmd() * All cgit command functions. * cgit_clone_info() * cgit_clone_objects() * cgit_clone_head() * cgit_print_plain() * cgit_show_stats() In initialization routines, use the global context variable instead of passing a pointer around locally. Remove callback data parameter for cache slots This is no longer needed since the context is always read from the global context variable. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>