Website Summary Files Commits Branches @commit @diff @stats
path: root / ui-repolist.c
Commit message (Collapse)AuthorAgeLinesSHA
* 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>
* Update copyright headers to have latest dates.
 Jason A. Donenfeld
2012-07-12-0/+17f08e03
|
* ui-repolist: Case insensitive sorting and age sort
 Jason A. Donenfeld
2012-07-12-4/+18184c565
| | | | | | Add two options, one for doing the ordinary name sorts in a case-insensitive manner, and another for choosing to sort repos in each section by age instead of by name.
* Merge branch 'jp/defbranch'
 Lars Hjemli
2012-03-18-1/+2181b6e7
|\
| * ui-repolist.c: fallback to "master" if no default branch is specified
 Lars Hjemli
2011-07-19-1/+25293c8b
| | | | | | | | | | | | | | | | When looking for the modtime of a repo we used to rely on repo.defbranch having a value. This is no longer true so this patch provides a default value when needed. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* | Merge branch 'stable'
 Lars Hjemli
2012-01-03-3/+304254fa
|\ \ | |/ |/|
| * Add sort parameter to pager of repo list
 Tobias Grimm
2012-01-03-3/+37530d94
| | | | | | | | | | | | When the repolist is paged, the page-links are missing the sort parameter, causing the initial page to be custom sorted, but any clicked page will then be with the default sort order again.
* | cgit.c: always setup cgit repo environment variables
 Lars Hjemli
2011-06-13-1/+13ec6b30
| | | | | | | | | | | | | | | | | | | | | | | | When cgit learned to setup environment variables for certain repo settings before invoking a filter process, the setup occurred inside cgit_open_filter(). This patch moves the setup out of cgit_open_filter() and into prepare_repo_cmd() to prepare for additional uses of these variables. Reviewed-by: Ferry Huberts <mailings@hupie.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* | ui_repolist: get modtime from packed-refs as fallback
 Ferry Huberts
2011-05-30-3/+1221e0e0b
| | | | | | | | | | | | | | | | | | | | | | When no modtime could be determined then as a final fallback try to get it from the packed-refs. This will show an idle time when a repository has been packed with all refs in the packed-refs. Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* | Merge branch 'fh/filter-api'
 Lars Hjemli
2011-05-23-1/+1ab350a7
|\ \ | |/ |/| | | | | Conflicts: cgit.c
| * cgit_open_filter: also take the repo as a parameter
 Ferry Huberts
2011-03-26-1/+1d87bba8
| | | | | | | | | | | | | | | | To prepare for handing repo configuration to the filter script that is executed. Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* | ui-repolist.c: do not return random/stale data from read_agefile
 Lars Hjemli
2011-05-23-1/+1c8ea73c
|/ | | | | | | | | | | When git/date.c:parse_date() cannot parse its input it returns -1. But read_agefile() checks if the result is different from zero, essentialy returning random data from the date buffer when parsing fails. This patch fixes the issue by verifying that the result from parse_date() is positive. Noticed-by: Julius Plenz <plenz@cis.fu-berlin.de> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* ui-repolist: fix redefinition of _XOPEN_SOURCE
 Mark Lodato
2010-09-04-6/+025e8ba1
| | | | | | | | | | | | Previously, ui-repolist.c set _GNU_SOURCE and then included a standard library before including <git-compat-util.h>. This was a problem, because <git-compat-util.h> redefined _XOPEN_SOURCE, which is set automatically by glibc when _GNU_SOURCE is set. However, <git-compat-util.h> already sets _GNU_SOURCE and includes both <string.h> and <time.h>, so there is no need to define _GNU_SOURCE or include either header within ui-repolist.c. Signed-off-by: Mark Lodato <lodatom@gmail.com>
* Fix repolist search links with virtual root
 Geoff Johnstone
2009-09-20-1/+19735835
| | | | | Signed-off-by: Geoff Johnstone <geoff.johnstone@googlemail.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* ui-repolist: handle empty sections similar to NULL sections
 Lars Hjemli
2009-08-24-7/+11e01229c
| | | | Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* ui-repolist.c: sort by section name, repo name as default
 Lars Hjemli
2009-08-24-0/+1563816ec
| | | | | | | | When no sorting is requested by the client, cgit will now sort by section name followed by repo name. This allows repos to be registered/ discovered independently of their display order. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Introduce 'section' as canonical spelling for 'repo.group'
 Lars Hjemli
2009-08-24-9/+9e7af002
| | | | | | | | The 'repo.' prefix should be reserved for repo-specific options, but the option 'repo.group' must still be honored to stay backwards compatible. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Add and use a common readfile() function
 Lars Hjemli
2009-08-18-9/+10e16f178
| | | | | | | | | | | | This function is used to read the full content of a textfile into a newly allocated buffer (with zerotermination). It replaces the earlier readfile() in scan-tree.c (which was rather error-prone[1]), and is reused by read_agefile() in ui-repolist.c. 1: No checks for EINTR and EAGAIN, fixed-size buffer Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Merge branch 'stable'
 Lars Hjemli
2009-08-18-0/+1523c133
|\
| * truncate buffer before reading empty files
 Simon Arlott
2009-08-18-0/+1011f2e9
| | | | | | | | | | | | | | | | | | | | If readfile() reads an empty file, fgets() won't truncate the buffer and it'll still contain the contents of the previously read file. [lh: fixed similar issue in ui-repolist.c] Signed-off-by: Simon Arlott <simon@fire.lp0.eu> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* | Add 'about-filter' and 'repo.about-filter' options
 Lars Hjemli
2009-08-09-2/+7537c05f
|/ | | | | | | | These options can be used to execute a filter command on each about-page, both top-level and for each repository (repo.about-filter can be used to override the current about-filter). Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Merge branch 'full-log'
 Lars Hjemli
2008-12-06-1/+13c32fe0
|\ | | | | | | | | | | Conflicts: cgit.c cgit.h
| * ui-log: add support for showing the full commit message
 Lars Hjemli
2008-11-29-1/+10274b57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some users prefer to see the full message, so to make these users happy the new querystring parameter "showmsg" can be used to print the full commit message per log entry. A link is provided in the log heading to make this function accessible, and all links and forms tries to preserve the users preference. Note: the new link is not displayed on the summary page since the point of the summary page is to be a summary, but it is still obeyed if specified manually. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* | Merge branch 'lh/sort-repolist'
 Lars Hjemli
2008-12-06-14/+1219c8be94
|\ \
| * | ui-repolist: implement lazy caching of repo->mtime
 Lars Hjemli
2008-11-29-4/+128813170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When sorting the list of repositories by their last modification time, cgit would (in the worst case) invoke fstat(3) four times and open(3) twice for each callback from qsort(3). This obviously scales very badly. Now, the calculated modtime for each repo is saved in repo->mtime, thus keeping the number of stat/open invocations identical for sorted and unsorted repo-listings. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| * | ui-repolist: sort null values last
 Lars Hjemli
2008-11-29-2/+254272e6
| | | | | | | | | | | | | | | | | | | | | When sorting on e.g. owner, it's not interesting to get all repos without owner at the top of the list. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| * | ui-repolist: add support for sorting any column
 Lars Hjemli
2008-11-29-9/+83f250c1c
| | | | | | | | | | | | Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| * | ui-repolist: extract get_repo_modtime() from print_modtime()
 Lars Hjemli
2008-11-29-27/+19cbac02c
| | | | | | | | | | | | | | | | | | | | | The new function is then used by both print_modtime() and cgit_reposort_modtime(). Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| * | Add support for sorting by Age in the repolist
 Benjamin Close
2008-11-29-3/+36d71c0c7
| |/ | | | | | | Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* / ui-repolist: avoid build warning for strcasestr(3)
 Lars Hjemli
2008-12-05-0/+47115f7d
|/ | | | | | | The non-standard function strcasestr is only defined if _GNU_SOURCE has also been defined. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* ui-repolist: handle empty agefiles
 Lars Hjemli
2008-11-14-1/+2c7d1402
| | | | | | | When the agefile was empty the old code would happily reuse the static buffer filled by a previous call to read_agefile(). Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* ui-repolist + ui-shared: Use cgit_summary_link()
 Lars Hjemli
2008-10-05-6/+249ecbbd
| | | | | | | This makes is possible to use cgit with repository urls containing special url characters like '#' and '?'. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* ui-repolist: enable filtering of repos by path
 Lars Hjemli
2008-09-15-1/+10dd80ef5
| | | | | | | If a repo url is specified but no exact match is found in the list of repos the url will now be used as a prefix-filter. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Add a pager on the repolist
 Lars Hjemli
2008-05-03-1/+18c6078b8
| | | | | | | | This enables a pager on the repolist which restricts the number of entries displayed per page, controlled by the new option `max-repo-count` (default value 50). Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Prepare for 'about site' page / add 'root-readme' option to cgitrc
 Lars Hjemli
2008-04-29-0/+6c6431a7
| | | | | | | The new option names a file which will be included on a new page, next to the current 'index' page. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Move included header-file out of repolist table
 Lars Hjemli
2008-04-29-6/+38062817
| | | | | | | | | When the 'index-header' option is specified in cgitrc we used to print the included file content inside the repolist table, which is bad style. This commit makes the included file be printed before the table. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Make a few more columns in repolist and log view clickable
 Lars Hjemli
2008-04-14-0/+2e9a7042
| | | | | | Less mouse movement is nice. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
* Make repository search case insensitive
 Lars Hjemli
2008-04-13-4/+428d781f
| | | | | | | This reuses the strcasestr() compiled or linked by libgit.a to implement a case insensitive variation of the repository search. Signed-off-by: Lars Hjemli <hjemli@gmail.com>