aboutsummaryrefslogtreecommitdiffstats
path: root/cgitrc.5.txt
diff options
context:
space:
mode:
authorGravatar Ferry Huberts <ferry.huberts@pelagic.nl>2011-03-23 19:57:44 (JST)
committerGravatar Lars Hjemli <hjemli@gmail.com>2011-03-26 19:03:42 (JST)
commitb2cf630a4b423bbda6507b7f658042563e76b36e (patch)
tree53d073b899308bda7416bafbf77e64616bf9f459 /cgitrc.5.txt
parent14f28923a2ed31fba9bf7042e8e2dff21717c333 (diff)
downloadcgit-b2cf630a4b423bbda6507b7f658042563e76b36e.zip
cgit-b2cf630a4b423bbda6507b7f658042563e76b36e.tar.gz
filters: document environment variables in filter scripts
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgitrc.5.txt')
-rw-r--r--cgitrc.5.txt47
1 files changed, 42 insertions, 5 deletions
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index c3698a6..60539d7 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -31,7 +31,7 @@ about-filter::
31 about pages (both top-level and for each repository). The command will 31 about pages (both top-level and for each repository). The command will
32 get the content of the about-file on its STDIN, and the STDOUT from the 32 get the content of the about-file on its STDIN, and the STDOUT from the
33 command will be included verbatim on the about page. Default value: 33 command will be included verbatim on the about page. Default value:
34 none. 34 none. See also: "FILTER API".
35 35
36agefile:: 36agefile::
37 Specifies a path, relative to each repository path, which can be used 37 Specifies a path, relative to each repository path, which can be used
@@ -81,6 +81,7 @@ commit-filter::
81 The command will get the message on its STDIN, and the STDOUT from the 81 The command will get the message on its STDIN, and the STDOUT from the
82 command will be included verbatim as the commit message, i.e. this can 82 command will be included verbatim as the commit message, i.e. this can
83 be used to implement bugtracker integration. Default value: none. 83 be used to implement bugtracker integration. Default value: none.
84 See also: "FILTER API".
84 85
85css:: 86css::
86 Url which specifies the css document to include in all cgit pages. 87 Url which specifies the css document to include in all cgit pages.
@@ -316,7 +317,7 @@ source-filter::
316 and the name of the blob as its only command line argument. The STDOUT 317 and the name of the blob as its only command line argument. The STDOUT
317 from the command will be included verbatim as the blob contents, i.e. 318 from the command will be included verbatim as the blob contents, i.e.
318 this can be used to implement e.g. syntax highlighting. Default value: 319 this can be used to implement e.g. syntax highlighting. Default value:
319 none. 320 none. See also: "FILTER API".
320 321
321summary-branches:: 322summary-branches::
322 Specifies the number of branches to display in the repository "summary" 323 Specifies the number of branches to display in the repository "summary"
@@ -349,7 +350,7 @@ REPOSITORY SETTINGS
349------------------- 350-------------------
350repo.about-filter:: 351repo.about-filter::
351 Override the default about-filter. Default value: none. See also: 352 Override the default about-filter. Default value: none. See also:
352 "enable-filter-overrides". 353 "enable-filter-overrides". See also: "FILTER API".
353 354
354repo.clone-url:: 355repo.clone-url::
355 A list of space-separated urls which can be used to clone this repo. 356 A list of space-separated urls which can be used to clone this repo.
@@ -357,7 +358,7 @@ repo.clone-url::
357 358
358repo.commit-filter:: 359repo.commit-filter::
359 Override the default commit-filter. Default value: none. See also: 360 Override the default commit-filter. Default value: none. See also:
360 "enable-filter-overrides". 361 "enable-filter-overrides". See also: "FILTER API".
361 362
362repo.defbranch:: 363repo.defbranch::
363 The name of the default branch for this repository. If no such branch 364 The name of the default branch for this repository. If no such branch
@@ -428,7 +429,7 @@ repo.section::
428 429
429repo.source-filter:: 430repo.source-filter::
430 Override the default source-filter. Default value: none. See also: 431 Override the default source-filter. Default value: none. See also:
431 "enable-filter-overrides". 432 "enable-filter-overrides". See also: "FILTER API".
432 433
433repo.url:: 434repo.url::
434 The relative url used to access the repository. This must be the first 435 The relative url used to access the repository. This must be the first
@@ -448,6 +449,42 @@ Note: the "repo." prefix is dropped from the option names in repo-specific
448config files, e.g. "repo.desc" becomes "desc". 449config files, e.g. "repo.desc" becomes "desc".
449 450
450 451
452FILTER API
453----------
454- about filter::
455 This filter is given no arguments.
456 The about text that is to be filtered is available on standard input and the
457 filtered text is expected on standard output.
458- commit filter::
459 This filter is given no arguments.
460 The commit message text that is to be filtered is available on standard input
461 and the filtered text is expected on standard output.
462- source filter::
463 This filter is given a single parameter: the filename of the source file to
464 filter. The filter can use the filename to determine (for example) the syntax
465 highlighting mode.
466 The contents of the source file that is to be filtered is available on
467 standard input and the filtered contents is expected on standard output.
468
469Also, all filters are handed the following environment variables:
470- CGIT_REPO_URL ( = repo.url setting )
471- CGIT_REPO_NAME ( = repo.name setting )
472- CGIT_REPO_PATH ( = repo.path setting )
473- CGIT_REPO_OWNER ( = repo.owner setting )
474- CGIT_REPO_DEFBRANCH ( = repo.defbranch setting )
475- CGIT_REPO_SECTION ( = section setting )
476- CGIT_REPO_CLONE_URL ( = repo.clone-url setting )
477
478If a setting is not defined for a repository and the corresponding global
479setting is also not defined (if applicable), then the corresponding
480environment variable will be an empty string.
481
482Note that under normal circumstance all these environment variables are
483defined. If however the total size of the defined settings exceed the
484allocated buffer within cgit then only the environment variables that fit
485in the allocated buffer are handed to the filter.
486
487
451EXAMPLE CGITRC FILE 488EXAMPLE CGITRC FILE
452------------------- 489-------------------
453 490