Website Summary Files Commits Branches @commit @diff @stats
path: root / ui-repolist.c
Commit message (Collapse)AuthorAgeLinesSHA
* cgit: truncate all config values at the newline
 Jason A. Donenfeld
2026-05-04-1/+1ed05b10
| | | | | | | | | | | | | | | | | 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 anchors
 Chris Mayo
2022-12-19-1/+1afffc3e
| | | | | | | | | | 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) value
 Christian Hesse
2019-11-22-1/+1583aa5d
| | | | | | | | 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 possible
 Christian Hesse
2019-06-05-1/+1ccba7eb
| | | | Signed-off-by: Christian Hesse <mail@eworm.de>
* global: remove functionality we deprecated for cgit v1.0
 Christian Hesse
2018-06-27-3/+054d37dc
| | | | | | | | 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 ellipsis
 Jeff Smith
2017-10-03-1/+27078725
| | | | | | | | | 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
2017-04-05-1/+07ebdb30
| | | | Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
* ui-repolist: properly sort by age
 Jason A. Donenfeld
2017-03-30-21/+1787c4748
| | | | | | | | | | | | | 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 rows
 Christian Hesse
2016-11-23-1/+181509a2
| | | | | | This is stolen from kernel.org css [0]. [0] https://git.kernel.org/cgit-korg-0.10.1.css
* ui-repolist: fix memory leak
 Christian Hesse
2016-10-12-1/+37fea585
|
* ui-repolist: fix memory leak
 Christian Hesse
2016-10-07-1/+4c177379
|
* ui: show ages in the originator's timezone
 John Keeping
2016-02-08-1/+1f2a901d
| | | | | | | 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
2016-02-08-1/+157ea1aa
| | | | | | | 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 found
 Peter Colberg
2016-01-13-3/+179abe4a2
| | | | | | | | | 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 function
 Peter Colberg
2016-01-13-3/+10a4014d0
| | | | Signed-off-by: Peter Colberg <peter@colberg.org>
* ui-repolist: initialize char *buf to NULL
 Christian Hesse
2016-01-13-1/+16edc84b
| | | | | | | 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_currenturl
 Christian Hesse
2015-10-09-1/+351338f7
| | | | | Coverity-id: 13930 Signed-off-by: Christian Hesse <mail@eworm.de>
* ui-repolist: fix resource leak: free before return
 Christian Hesse
2015-10-09-1/+37ef1a47
| | | | | Coverity-id: 13931 Signed-off-by: Christian Hesse <mail@eworm.de>
* about: move layout into page functions
 John Keeping
2015-08-14-1/+451d9176
| | | | Signed-off-by: John Keeping <john@keeping.me.uk>
* Remove redundant includes
 John Keeping
2015-08-13-1/+0157f544
| | | | | | | 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 file
 John Keeping
2015-08-12-1/+130304d8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
2015-03-09-2/+2ad74669
| | | | | | | 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 declarations
 John Keeping
2015-03-09-3/+3e3d3fff
| | | | | | | | 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
2015-03-03-1/+12e4a41e
|
* ui-shared: Add current url helper function.
 Jason A. Donenfeld
2015-03-03-2/+26bcda2f
|
* ui-repolist: use ctx.qry.url instead of rooturl, in case we're filtering
 Jason A. Donenfeld
2015-03-03-2/+2c3473e8
|
* ui-repolist: use correct owner query link
 Jason A. Donenfeld
2015-03-03-1/+1e14eee9
|
* Add repo.hide and repo.ignore
 Lukas Fleischer
2015-01-29-0/+2c58cec9
| | | | | | | | 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-filter
 Chris Burroughs
2014-12-23-7/+1396ceb9a
| | | | | | 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.1
 Christian Hesse
2014-12-23-3/+417838ec
| | | | | | Update to git version v2.2.1, including API changes. Signed-off-by: Christian Hesse <mail@eworm.de>
* git: update for git 2.0
 Christian Hesse
2014-06-28-1/+179c985e
| | | | | | | 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 search
 Jason A. Donenfeld
2014-01-17-0/+6a2b6b37
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Switch to exclusively using global ctx
 Lukas Fleischer
2014-01-17-3/+3f60ffa1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* filter: return on null filter from open and close
 Jason A. Donenfeld
2014-01-14-4/+2800380d
| | | | | | | | So that we don't have to include the if(filter) open_filter(filter) block everywhere, we introduce the guard in the function itself. This should simplify quite a bit of code. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui-repolist: HTML-escape cgit_rooturl() response
 John Keeping
2014-01-12-1/+31de6591
| | | | | | | This is for consistency with other callers. The value returned from cgit_rooturl is not guaranteed to be HTML-safe. Signed-off-by: John Keeping <john@keeping.me.uk>
* filter: pass extra arguments via cgit_open_filter
 John Keeping
2014-01-12-7/+33d8a650
| | | | | | | | | This avoids poking into the filter data structure at various points in the code. We rely on the fact that the number of arguments is fixed based on the filter type (set in cgit_new_filter) and that the call sites all know which filter type they're using. Signed-off-by: John Keeping <john@keeping.me.uk>
* Update copyright information
 Lukas Fleischer
2014-01-08-2/+1f7f26f8
| | | | | | | | | * Name "cgit Development Team" as copyright holder to avoid listing every single developer. * Update copyright ranges. Signed-off-by: Lukas Fleischer <cgit@crytocrack.de>
* ui-summary: Pass filename to about-filter
 Jason A. Donenfeld
2013-05-25-2/+6c0dfaf1
| | | | | | | | | | This gives the about-filter API the same semantics as source-filter, where the filter receives the filename so it can decide what to do next with it. While we're at it, plug a memory leak. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* use struct strbuf instead of static buffers
 John Keeping
2013-04-08-12/+16fb3655d
| | | | | | | | | | | | | | | | | | | Use "struct strbuf" from Git to remove the limit on file path length. Notes on scan-tree: This is slightly involved since I decided to pass the strbuf into add_repo() and modify if whenever a new file name is required, which should avoid any extra allocations within that function. The pattern there is to append the filename, use it and then reset the buffer to its original length (retaining a trailing '/'). Notes on ui-snapshot: Since write_archive modifies the argv array passed to it we copy the argv_array values into a new array of char* and then free the original argv_array structure and the new array without worrying about what the values now look like. Signed-off-by: John Keeping <john@keeping.me.uk>
* Always #include corresponding .h in .c files
 John Keeping
2013-04-08-0/+18f20879
| | | | | | | | | | | | While doing this, remove declarations from header files where the corresponding definition is declared "static" in order to avoid build errors. Also re-order existing headers in ui-*.c so that the file-specific header always comes immediately after "cgit.h", helping with future consistency. Signed-off-by: John Keeping <john@keeping.me.uk>
* Convert pager navigation into a unordered list
 Lukas Fleischer
2013-03-20-2/+4b60e6bf
| | | | | | | | | | It is common practice and semantically appropriate to use unordered lists for long navigation lists. This also fixes the layout of very long pager navigations in Webkit-based browsers. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
* Mark several functions/variables static
 Lukas Fleischer
2013-03-04-7/+7bafab42
| | | | | | Spotted by parsing the output of `gcc -Wmissing-prototypes [...]`. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
* White space around control verbs.
 Jason A. Donenfeld
2013-03-04-2/+2bdae1d8
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Fix several whitespace errors
 Lukas Fleischer
2013-03-04-3/+353bc747
| | | | | | | | | | * Remove whitespace at the end of lines. * Replace space indentation by tabs. * Add whitespace before/after several operators ("+", "-", "*", ...) * Add whitespace to assignments ("foo = bar;"). * Fix whitespace in parameter lists ("foobar(foo, bar, 42)"). Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
* Make "owner" column on index page configurable
 Florian Pritz
2013-02-01-7/+12b1e172a
| | | | | | | | | This is not really needed for personal sites where all repos belong to the same person. Since it is pretty useful for shared sites however, it should be configurable. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui-repolist: Add "section-sort" flag to control section sorting.
 Tobias Bieniek
2012-10-17-1/+17a4e7c8
| | | | | | | | Flag which, when set to "1", will sort the sections on the repository listing by name. Set this flag to "0" if the order in the cgitrc file should be preserved. Default value: "1". Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: Remember to print ampersand as proper html entities.
 William Bell
2012-10-17-1/+1c366bd6
|
* ui-repolist: Rename section-sort to repository-sort.
 Jason A. Donenfeld
2012-10-16-1/+1fdfb6a6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui-repolist: do not use agefile if it's date could not be parsed
 Ferry Huberts
2012-10-09-2/+4e52a522
| | | | Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
* ui-repolist: Bold the currently viewed page.
 Jamie Couture
2012-10-08-4/+74675b91
| | | | Signed-off-by: Jamie Couture <jamie.couture@gmail.com>