:man source: cgit :man manual: cgit CGITRC(5) ======== NAME ---- cgitrc - runtime configuration for cgit SYNOPSIS -------- Cgitrc contains all runtime settings for cgit, including the list of git repositories, formatted as a line-separated list of NAME=VALUE pairs. Blank lines, and lines starting with '#', are ignored. LOCATION -------- The default location of cgitrc, defined at compile time, is /etc/cgitrc. At runtime, cgit will consult the environment variable CGIT_CONFIG and, if defined, use its value instead. GLOBAL SETTINGS --------------- about-filter:: Specifies a command which will be invoked to format the content of about pages (both top-level and for each repository). The command will get the content of the about-file on its STDIN, the name of the file as the first argument, and the STDOUT from the command will be included verbatim on the about page. Default value: none. See also: "FILTER API". agefile:: Specifies a path, relative to each repository path, which can be used to specify the date and time of the youngest commit in the repository. The first line in the file is used as input to the "parse_date" function in libgit. Recommended timestamp-format is "yyyy-mm-dd hh:mm:ss". You may want to generate this file from a post-receive hook. Default value: "info/web/last-modified". branch-sort:: Flag which, when set to "age", enables date ordering in the branch ref list, and when set to "name" enables ordering by branch name. Default value: "name". cache-root:: Path used to store the cgit cache entries. Default value: "/var/cache/cgit". See also: "MACRO EXPANSION". cache-static-ttl:: Number which specifies the time-to-live, in minutes, for the cached version of repository pages accessed with a fixed SHA1. Negative values have infinite ttl. Default value: -1". cache-dynamic-ttl:: Number which specifies the time-to-live, in minutes, for the cached version of repository pages accessed without a fixed SHA1. Negative values have infinite ttl. Default value: "5". cache-repo-ttl:: Number which specifies the time-to-live, in minutes, for the cached version of the repository summary page. Negative values have infinite ttl. Default value: "5". cache-root-ttl:: Number which specifies the time-to-live, in minutes, for the cached version of the repository index page. Negative values have infinite ttl. Default value: "5". cache-scanrc-ttl:: Number which specifies the time-to-live, in minutes, for the result of scanning a path for git repositories. Negative values have infinite ttl. Default value: "15". cache-about-ttl:: Number which specifies the time-to-live, in minutes, for the cached version of the repository about page. Negative values have infinite ttl. Default value: "15". cache-size:: The maximum number of entries in the cgit cache. Default value: "0" (i.e. caching is disabled). case-sensitive-sort:: Sort items in the repo list case sensitively. Default value: "1". See also: repository-sort, section-sort. clone-prefix:: Space-separated list of common prefixes which, when combined with a repository url, generates valid clone urls for the repository. This setting is only used if `repo.clone-url` is unspecified. Default value: none. clone-url:: Space-separated list of clone-url templates. This setting is only used if `repo.clone-url` is unspecified. Default value: none. See also: "MACRO EXPANSION", "FILTER API". commit-filter:: Specifies a command which will be invoked to format commit messages. The command will get the message on its STDIN, and the STDOUT from the command will be included verbatim as the commit message, i.e. this can be used to implement bugtracker integration. Default value: none. See also: "FILTER API". commit-sort:: Flag which, when set to "date", enables strict date ordering in the commit log, and when set to "topo" enables strict topological ordering. If unset, the default ordering of "git log" is used. Default value: unset. css:: U
#!/bin/sh
. ./setup.sh
prepare_tests "Check content on commit page"
run_test 'generate foo/commit' 'cgit_url "foo/commit" >trash/tmp'
run_test 'find tree link' 'grep -e "<a href=./foo/tree/.>" trash/tmp'
run_test 'find parent link' 'grep -E "<a href=./foo/commit/\?id=.+>" trash/tmp'
run_test 'find commit subject' '
grep -e "<div class=.commit-subject.>commit 5<" trash/tmp
'
run_test 'find commit msg' 'grep -e "<div class=.commit-msg.></div>" trash/tmp'
run_test 'find diffstat' 'grep -e "<table summary=.diffstat. class=.diffstat.>" trash/tmp'
run_test 'find diff summary' '
grep -e "1 files changed, 1 insertions, 0 deletions" trash/tmp
'
run_test 'get root commit' '
root=$(cd trash/repos/foo && git rev-list --reverse HEAD | head -1) &&
cgit_url "foo/commit&id=$root" >trash/tmp &&
grep "</html>" trash/tmp
'
run_test 'root commit contains diffstat' '
grep "<a href=./foo/diff/file-1.id=[0-9a-f]\{40\}.>file-1</a>" trash/tmp
'
run_test 'root commit contains diff' '
grep ">diff --git a/file-1 b/file-1<" trash/tmp &&
grep -e "<div class=.add.>+1</div>" trash/tmp
'
tests_done