From: Lars Hjemli Date: Mon, 13 Jun 2011 22:02:02 +0000 (+0000) Subject: Merge branch 'stable' X-Git-Tag: v0.9.1~55 X-Git-Url: https://git.cameronkatri.com/cgit.git/commitdiff_plain/859d106d5e8d884bf8f25b2ceea8600b2987c387 Merge branch 'stable' Conflicts: cgitrc.5.txt --- 859d106d5e8d884bf8f25b2ceea8600b2987c387 diff --cc cgitrc.5.txt index 5903a93,10b86f3..8e31578 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@@ -456,42 -452,26 +458,62 @@@ Note: the "repo." prefix is dropped fro 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 ( = repo.url setting ) +- CGIT_REPO_NAME ( = repo.name setting ) +- CGIT_REPO_PATH ( = repo.path setting ) +- CGIT_REPO_OWNER ( = repo.owner setting ) +- CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) +- CGIT_REPO_SECTION ( = section setting ) +- CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) + +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. + +Note that under normal circumstance all these environment variables are +defined. If however the total size of the defined settings exceed the +allocated buffer within cgit then only the environment variables that fit +in the allocated buffer are handed to the filter. + + + 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 -------------------