]> gitweb.ps.run Git - ps-cgit/blobdiff - cgitrc.5.txt
cgitrc.5.txt: reformat the "FILTER API" section
[ps-cgit] / cgitrc.5.txt
index b8c69b893ec5c1b5255274dd69ff1d972878f43f..9a9965b479f38fa7b2947a7ee90087304781daae 100644 (file)
@@ -31,7 +31,7 @@ about-filter::
        about pages (both top-level and for each repository). The command will
        get the content of the about-file on its STDIN, and the STDOUT from the
        command will be included verbatim on the about page. Default value:
-       none.
+       none. See also: "FILTER API".
 
 agefile::
        Specifies a path, relative to each repository path, which can be used
@@ -42,7 +42,7 @@ agefile::
 
 cache-root::
        Path used to store the cgit cache entries. Default value:
-       "/var/cache/cgit".
+       "/var/cache/cgit". See also: "MACRO EXPANSION".
 
 cache-dynamic-ttl::
        Number which specifies the time-to-live, in minutes, for the cached
@@ -81,6 +81,7 @@ commit-filter::
        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".
 
 css::
        Url which specifies the css document to include in all cgit pages.
@@ -90,7 +91,12 @@ embedded::
        Flag which, when set to "1", will make cgit generate a html fragment
        suitable for embedding in other html pages. Default value: none. See
        also: "noheader".
-       
+
+enable-commit-graph::
+       Flag which, when set to "1", will make cgit print an ASCII-art commit
+       history graph to the left of the commit messages in the repository
+       log page. Default value: "0".
+
 enable-filter-overrides::
        Flag which, when set to "1", allows all filter settings to be
        overridden in repository-specific cgitrc files. Default value: none.
@@ -155,7 +161,7 @@ header::
 
 include::
        Name of a configfile to include before the rest of the current config-
-       file is parsed. Default value: none.
+       file is parsed. Default value: none. See also: "MACRO EXPANSION".
 
 index-header::
        The content of the file specified with this option will be included
@@ -237,7 +243,8 @@ noheader::
 project-list::
        A list of subdirectories inside of scan-path, relative to it, that
        should loaded as git repositories. This must be defined prior to
-       scan-path. Default value: none. See also: scan-path.
+       scan-path. Default value: none. See also: scan-path, "MACRO
+       EXPANSION".
 
 readme::
        Text which will be used as default value for "repo.readme". Default
@@ -274,13 +281,23 @@ root-title::
        Text printed as heading on the repository index page. Default value:
        "Git Repository Browser".
 
+scan-hidden-path::
+       If set to "1" and scan-path is enabled, scan-path will recurse into
+       directories whose name starts with a period ('.'). Otherwise,
+       scan-path will stay away from such directories (considered as
+       "hidden"). Note that this does not apply to the ".git" directory in
+       non-bare repos. This must be defined prior to scan-path.
+       Default value: 0. See also: scan-path.
+
 scan-path::
        A path which will be scanned for repositories. If caching is enabled,
        the result will be cached as a cgitrc include-file in the cache
        directory. If project-list has been defined prior to scan-path,
        scan-path loads only the directories listed in the file pointed to by
-       project-list. Default value: none. See also: cache-scanrc-ttl,
-       project-list.
+       project-list. Be advised that only the global settings taken
+       before the scan-path directive will be applied to each repository.
+       Default value: none. See also: cache-scanrc-ttl, project-list,
+       "MACRO EXPANSION".
 
 section::
        The name of the current repository section - all repositories defined
@@ -300,7 +317,8 @@ side-by-side-diffs::
 snapshots::
        Text which specifies the default set of snapshot formats generated by
        cgit. The value is a space-separated list of zero or more of the
-       values "tar", "tar.gz", "tar.bz2" and "zip". Default value: none.
+       values "tar", "tar.gz", "tar.bz2", "tar.xz" and "zip". Default value:
+       none.
 
 source-filter::
        Specifies a command which will be invoked to format plaintext blobs
@@ -308,7 +326,7 @@ source-filter::
        and the name of the blob as its only command line argument. The STDOUT
        from the command will be included verbatim as the blob contents, i.e.
        this can be used to implement e.g. syntax highlighting. Default value:
-       none.
+       none. See also: "FILTER API".
 
 summary-branches::
        Specifies the number of branches to display in the repository "summary"
@@ -341,7 +359,7 @@ REPOSITORY SETTINGS
 -------------------
 repo.about-filter::
        Override the default about-filter. Default value: none. See also:
-       "enable-filter-overrides".
+       "enable-filter-overrides". See also: "FILTER API".
 
 repo.clone-url::
        A list of space-separated urls which can be used to clone this repo.
@@ -349,7 +367,7 @@ repo.clone-url::
 
 repo.commit-filter::
        Override the default commit-filter. Default value: none. See also:
-       "enable-filter-overrides".
+       "enable-filter-overrides". See also: "FILTER API".
 
 repo.defbranch::
        The name of the default branch for this repository. If no such branch
@@ -359,6 +377,10 @@ repo.defbranch::
 repo.desc::
        The value to show as repository description. Default value: none.
 
+repo.enable-commit-graph::
+       A flag which can be used to disable the global setting
+       `enable-commit-graph'. Default value: none.
+
 repo.enable-log-filecount::
        A flag which can be used to disable the global setting
        `enable-log-filecount'. Default value: none.
@@ -375,6 +397,15 @@ repo.enable-subject-links::
        A flag which can be used to override the global setting
        `enable-subject-links'. Default value: none.
 
+repo.logo::
+       Url which specifies the source of an image which will be used as a logo
+       on this repo's pages. Default value: global logo.
+
+repo.logo-link::
+       Url loaded when clicking on the cgit logo image. If unspecified the
+       calculated url of the repository index page will be used. Default
+       value: global logo-link.
+
 repo.max-stats::
        Override the default maximum statistics period. Valid values are equal
        to the values specified for the global "max-stats" setting. Default
@@ -407,7 +438,7 @@ repo.section::
 
 repo.source-filter::
        Override the default source-filter. Default value: none. See also:
-       "enable-filter-overrides".
+       "enable-filter-overrides". See also: "FILTER API".
 
 repo.url::
        The relative url used to access the repository. This must be the first
@@ -427,6 +458,60 @@ Note: the "repo." prefix is dropped from the option names in repo-specific
 config files, e.g. "repo.desc" becomes "desc".
 
 
+FILTER API
+----------
+about filter::
+       This filter is given no arguments. The about text that is to be
+       filtered is available on standard input and the filtered text is
+       expected on standard output.
+
+commit filter::
+       This filter is given no arguments. The commit message text that is to
+       be filtered is available on standard input and the filtered text is
+       expected on standard output.
+
+source filter::
+       This filter is given a single parameter: the filename of the source
+       file to filter. The filter can use the filename to determine (for
+       example) the syntax highlighting mode. The contents of the source
+       file that is to be filtered is available on standard input and the
+       filtered contents is expected on standard output.
+
+Also, all filters are handed the following environment variables:
+
+- CGIT_REPO_URL (from repo.url)
+- CGIT_REPO_NAME (from repo.name)
+- CGIT_REPO_PATH (from repo.path)
+- CGIT_REPO_OWNER (from repo.owner)
+- CGIT_REPO_DEFBRANCH (from repo.defbranch)
+- CGIT_REPO_SECTION (from repo.section)
+- CGIT_REPO_CLONE_URL (from repo.clone-url)
+
+If a setting is not defined for a repository and the corresponding global
+setting is also not defined (if applicable), then the corresponding
+environment variable will be an empty string.
+
+
+MACRO EXPANSION
+---------------
+The following cgitrc options supports a simple macro expansion feature,
+where tokens prefixed with "$" are replaced with the value of a similary
+named environment variable:
+
+- cache-root
+- include
+- project-list
+- scan-path
+
+Macro expansion will also happen on the content of $CGIT_CONFIG, if
+defined.
+
+One usage of this feature is virtual hosting, which in its simplest form
+can be accomplished by adding the following line to /etc/cgitrc:
+
+       include=/etc/cgitrc.d/$HTTP_HOST
+
+
 EXAMPLE CGITRC FILE
 -------------------
 
@@ -446,6 +531,10 @@ css=/css/cgit.css
 enable-index-links=1
 
 
+# Enable ASCII art commit history graph on the log pages
+enable-commit-graph=1
+
+
 # Show number of affected files per commit on the log pages
 enable-log-filecount=1