1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
6 <meta http-equiv=
"Content-Type" content=
"application/xhtml+xml; charset=UTF-8" />
7 <meta name=
"generator" content=
"AsciiDoc 10.2.0" />
8 <title>gitweb.conf(
5)
</title>
9 <style type=
"text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
14 font-family: Georgia,serif;
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
22 #author, #revnumber, #revdate, #revremark,
24 font-family: Arial,Helvetica,sans-serif;
28 margin:
1em
5%
1em
5%;
33 text-decoration: underline;
49 h1, h2, h3, h4, h5, h6 {
57 border-bottom:
2px solid silver;
77 border:
1px solid silver;
88 ul
> li { color: #aaa; }
89 ul
> li
> * { color: black; }
91 .monospaced, code, pre {
92 font-family:
"Courier New", Courier, monospace;
99 white-space: pre-wrap;
109 #revnumber, #revdate, #revremark {
114 border-top:
2px solid silver;
120 padding-bottom:
0.5em;
124 padding-bottom:
0.5em;
129 margin-bottom:
1.5em;
131 div.imageblock, div.exampleblock, div.verseblock,
132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133 div.admonitionblock {
135 margin-bottom:
1.5em;
137 div.admonitionblock {
139 margin-bottom:
2.0em;
144 div.content { /* Block element content. */
148 /* Block element titles. */
149 div.title, caption.title {
154 margin-bottom:
0.5em;
160 td div.title:first-child {
163 div.content div.title:first-child {
166 div.content + div.title {
170 div.sidebarblock
> div.content {
172 border:
1px solid #dddddd;
173 border-left:
4px solid #f0f0f0;
177 div.listingblock
> div.content {
178 border:
1px solid #dddddd;
179 border-left:
5px solid #f0f0f0;
184 div.quoteblock, div.verseblock {
188 border-left:
5px solid #f0f0f0;
192 div.quoteblock
> div.attribution {
197 div.verseblock
> pre.content {
198 font-family: inherit;
201 div.verseblock
> div.attribution {
205 /* DEPRECATED: Pre version
8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
210 div.admonitionblock .icon {
214 text-decoration: underline;
216 padding-right:
0.5em;
218 div.admonitionblock td.content {
220 border-left:
3px solid #dddddd;
223 div.exampleblock
> div.content {
224 border-left:
3px solid #dddddd;
228 div.imageblock div.content { padding-left:
0; }
229 span.image img { border-style: none; vertical-align: text-bottom; }
230 a.image:visited { color: white; }
234 margin-bottom:
0.8em;
247 list-style-position: outside;
250 list-style-type: decimal;
253 list-style-type: lower-alpha;
256 list-style-type: upper-alpha;
259 list-style-type: lower-roman;
262 list-style-type: upper-roman;
265 div.compact ul, div.compact ol,
266 div.compact p, div.compact p,
267 div.compact div, div.compact div {
269 margin-bottom:
0.1em;
281 margin-bottom:
0.8em;
284 padding-bottom:
15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
292 padding-right:
0.8em;
298 div.hdlist.compact tr {
307 .footnote, .footnoteref {
311 span.footnote, span.footnoteref {
312 vertical-align: super;
316 margin:
20px
0 20px
0;
320 #footnotes div.footnote {
326 border-top:
1px solid silver;
335 padding-right:
0.5em;
336 padding-bottom:
0.3em;
344 #footer-badges { display: none; }
348 margin-bottom:
2.5em;
356 margin-bottom:
0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
376 span.aqua { color: aqua; }
377 span.black { color: black; }
378 span.blue { color: blue; }
379 span.fuchsia { color: fuchsia; }
380 span.gray { color: gray; }
381 span.green { color: green; }
382 span.lime { color: lime; }
383 span.maroon { color: maroon; }
384 span.navy { color: navy; }
385 span.olive { color: olive; }
386 span.purple { color: purple; }
387 span.red { color: red; }
388 span.silver { color: silver; }
389 span.teal { color: teal; }
390 span.white { color: white; }
391 span.yellow { color: yellow; }
393 span.aqua-background { background: aqua; }
394 span.black-background { background: black; }
395 span.blue-background { background: blue; }
396 span.fuchsia-background { background: fuchsia; }
397 span.gray-background { background: gray; }
398 span.green-background { background: green; }
399 span.lime-background { background: lime; }
400 span.maroon-background { background: maroon; }
401 span.navy-background { background: navy; }
402 span.olive-background { background: olive; }
403 span.purple-background { background: purple; }
404 span.red-background { background: red; }
405 span.silver-background { background: silver; }
406 span.teal-background { background: teal; }
407 span.white-background { background: white; }
408 span.yellow-background { background: yellow; }
410 span.big { font-size:
2em; }
411 span.small { font-size:
0.6em; }
413 span.underline { text-decoration: underline; }
414 span.overline { text-decoration: overline; }
415 span.line-through { text-decoration: line-through; }
417 div.unbreakable { page-break-inside: avoid; }
427 margin-bottom:
1.5em;
429 div.tableblock
> table {
430 border:
3px solid #
527bbd;
432 thead, p.table.header {
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock
> table[
frame=
"void"] {
443 div.tableblock
> table[
frame=
"hsides"] {
444 border-left-style: none;
445 border-right-style: none;
447 div.tableblock
> table[
frame=
"vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
460 margin-bottom:
1.5em;
462 thead, p.tableblock.header {
473 border-color: #
527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
480 border-color: #
527bbd;
483 table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
487 table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
491 table.tableblock.frame-none {
492 border-style: hidden;
495 th.tableblock.halign-left, td.tableblock.halign-left {
498 th.tableblock.halign-center, td.tableblock.halign-center {
501 th.tableblock.halign-right, td.tableblock.halign-right {
505 th.tableblock.valign-top, td.tableblock.valign-top {
508 th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
523 padding-bottom:
0.5em;
524 border-top:
2px solid silver;
525 border-bottom:
2px solid silver;
530 body.manpage div.sectionbody {
535 body.manpage div#toc { display: none; }
540 <script type=
"text/javascript">
542 var asciidoc = { // Namespace.
544 /////////////////////////////////////////////////////////////////////
545 // Table Of Contents generator
546 /////////////////////////////////////////////////////////////////////
548 /* Author: Mihai Bazon, September
2002
549 * http://students.infoiasi.ro/~mishoo
551 * Table Of Content generator
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
558 /* modified by Troy D. Hanson, September
2006. License: GPL */
559 /* modified by Stuart Rackham,
2006,
2009. License: GPL */
562 toc: function (toclevels) {
564 function getText(el) {
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType ==
3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
569 else if (i.firstChild != null)
575 function TocEntry(el, text, toclevel) {
578 this.toclevel = toclevel;
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([
1-'+(toclevels+
1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType ==
1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute(
"class") || i.getAttribute(
"className")) !=
"float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[
1]-
1);
602 var toc = document.getElementById(
"toc");
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
610 for (i =
0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute(
"class")
614 && entry.getAttribute(
"class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
617 for (i =
0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
621 // Rebuild TOC entries.
622 var entries = tocEntries(document.getElementById(
"content"), toclevels);
623 for (var i =
0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id ==
"")
626 entry.element.id =
"_toc_" + i;
627 var a = document.createElement(
"a");
628 a.href =
"#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement(
"div");
632 div.className =
"toclevel" + entry.toclevel;
633 toc.appendChild(div);
635 if (entries.length ==
0)
636 toc.parentNode.removeChild(toc);
640 /////////////////////////////////////////////////////////////////////
641 // Footnotes generator
642 /////////////////////////////////////////////////////////////////////
644 /* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/
2005/
07/format_footnote.html
648 footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
651 var noteholder = document.getElementById(
"footnotes");
655 var entriesToRemove = [];
656 for (i =
0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute(
"class") ==
"footnote")
659 entriesToRemove.push(entry);
661 for (i =
0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
665 // Rebuild footnote entries.
666 var cont = document.getElementById(
"content");
667 var spans = cont.getElementsByTagName(
"span");
670 for (i=
0; i
<spans.length; i++) {
671 if (spans[i].className ==
"footnote") {
673 var note = spans[i].getAttribute(
"data-note");
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[
1];
679 "[<a id='_footnoteref_" + n +
"' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n +
"</a>]";
681 spans[i].setAttribute(
"data-note", note);
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n +
"'>" +
685 "<a href='#_footnoteref_" + n +
"' title='Return to text'>" +
686 n +
"</a>. " + note +
"</div>";
687 var id =spans[i].getAttribute(
"id");
688 if (id != null) refs[
"#"+id] = n;
692 noteholder.parentNode.removeChild(noteholder);
694 // Process footnoterefs.
695 for (i=
0; i
<spans.length; i++) {
696 if (spans[i].className ==
"footnoteref") {
697 var href = spans[i].getElementsByTagName(
"a")[
0].getAttribute(
"href");
698 href = href.match(/#.*/)[
0]; // Because IE return full URL.
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n +
"</a>]";
708 install: function(toclevels) {
711 function reinstall() {
712 asciidoc.footnotes();
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
723 timerId = setInterval(reinstall,
500);
724 if (document.addEventListener)
725 document.addEventListener(
"DOMContentLoaded", reinstallAndRemoveTimer, false);
727 window.onload = reinstallAndRemoveTimer;
735 <body class=
"manpage">
738 gitweb.conf(
5) Manual Page
741 <div class=
"sectionbody">
743 Gitweb (Git web interface) configuration file
749 <h2 id=
"_synopsis">SYNOPSIS
</h2>
750 <div class=
"sectionbody">
751 <div class=
"paragraph"><p>/etc/gitweb.conf, /etc/gitweb-common.conf, $GITWEBDIR/gitweb_config.perl
</p></div>
755 <h2 id=
"_description">DESCRIPTION
</h2>
756 <div class=
"sectionbody">
757 <div class=
"paragraph"><p>The gitweb CGI script for viewing Git repositories over the web uses a
758 perl script fragment as its configuration file. You can set variables
759 using
"<code>our $variable = value</code>"; text from a
"#" character until the
760 end of a line is ignored. See
<strong>perlsyn
</strong>(
1) for details.
</p></div>
761 <div class=
"paragraph"><p>An example:
</p></div>
762 <div class=
"listingblock">
763 <div class=
"content">
764 <pre><code># gitweb configuration file for http://git.example.org
766 our $projectroot =
"/srv/git"; # FHS recommendation
767 our $site_name = 'Example.org
>> Repos';
</code></pre>
769 <div class=
"paragraph"><p>The configuration file is used to override the default settings that
770 were built into gitweb at the time the
<em>gitweb.cgi
</em> script was generated.
</p></div>
771 <div class=
"paragraph"><p>While one could just alter the configuration settings in the gitweb
772 CGI itself, those changes would be lost upon upgrade. Configuration
773 settings might also be placed into a file in the same directory as the
774 CGI script with the default name
<em>gitweb_config.perl
</em> — allowing
775 one to have multiple gitweb instances with different configurations by
776 the use of symlinks.
</p></div>
777 <div class=
"paragraph"><p>Note that some configuration can be controlled on per-repository rather than
778 gitweb-wide basis: see
"Per-repository gitweb configuration" subsection on
779 <a href=
"gitweb.html">gitweb(
1)
</a> manpage.
</p></div>
783 <h2 id=
"_discussion">DISCUSSION
</h2>
784 <div class=
"sectionbody">
785 <div class=
"paragraph"><p>Gitweb reads configuration data from the following sources in the
786 following order:
</p></div>
787 <div class=
"ulist"><ul>
790 built-in values (some set during build stage),
795 common system-wide configuration file (defaults to
796 <code>/etc/gitweb-common.conf
</code>),
801 either per-instance configuration file (defaults to
<em>gitweb_config.perl
</em>
802 in the same directory as the installed gitweb), or if it does not exist
803 then fallback system-wide configuration file (defaults to
<code>/etc/gitweb.conf
</code>).
807 <div class=
"paragraph"><p>Values obtained in later configuration files override values obtained earlier
808 in the above sequence.
</p></div>
809 <div class=
"paragraph"><p>Locations of the common system-wide configuration file, the fallback
810 system-wide configuration file and the per-instance configuration file
811 are defined at compile time using build-time Makefile configuration
812 variables, respectively
<code>GITWEB_CONFIG_COMMON
</code>,
<code>GITWEB_CONFIG_SYSTEM
</code>
813 and
<code>GITWEB_CONFIG
</code>.
</p></div>
814 <div class=
"paragraph"><p>You can also override locations of gitweb configuration files during
815 runtime by setting the following environment variables:
816 <code>GITWEB_CONFIG_COMMON
</code>,
<code>GITWEB_CONFIG_SYSTEM
</code> and
<code>GITWEB_CONFIG
</code>
817 to a non-empty value.
</p></div>
818 <div class=
"paragraph"><p>The syntax of the configuration files is that of Perl, since these files are
819 handled by sourcing them as fragments of Perl code (the language that
820 gitweb itself is written in). Variables are typically set using the
821 <code>our
</code> qualifier (as in
"<code>our $variable = <value>;</code>") to avoid syntax
822 errors if a new version of gitweb no longer uses a variable and therefore
823 stops declaring it.
</p></div>
824 <div class=
"paragraph"><p>You can include other configuration file using read_config_file()
825 subroutine. For example, one might want to put gitweb configuration
826 related to access control for viewing repositories via Gitolite (one
827 of Git repository management tools) in a separate file, e.g. in
828 <code>/etc/gitweb-gitolite.conf
</code>. To include it, put
</p></div>
829 <div class=
"listingblock">
830 <div class=
"content">
831 <pre><code>read_config_file(
"/etc/gitweb-gitolite.conf");
</code></pre>
833 <div class=
"paragraph"><p>somewhere in gitweb configuration file used, e.g. in per-installation
834 gitweb configuration file. Note that read_config_file() checks itself
835 that the file it reads exists, and does nothing if it is not found.
836 It also handles errors in included file.
</p></div>
837 <div class=
"paragraph"><p>The default configuration with no configuration file at all may work
838 perfectly well for some installations. Still, a configuration file is
839 useful for customizing or tweaking the behavior of gitweb in many ways, and
840 some optional features will not be present unless explicitly enabled using
841 the configurable
<code>%features
</code> variable (see also
"Configuring gitweb
842 features" section below).
</p></div>
846 <h2 id=
"_configuration_variables">CONFIGURATION VARIABLES
</h2>
847 <div class=
"sectionbody">
848 <div class=
"paragraph"><p>Some configuration variables have their default values (embedded in the CGI
849 script) set during building gitweb
 — if that is the case, this fact is put
850 in their description. See gitweb
’s
<em>INSTALL
</em> file for instructions on building
851 and installing gitweb.
</p></div>
853 <h3 id=
"_location_of_repositories">Location of repositories
</h3>
854 <div class=
"paragraph"><p>The configuration variables described below control how gitweb finds
855 Git repositories, and how repositories are displayed and accessed.
</p></div>
856 <div class=
"paragraph"><p>See also
"Repositories" and later subsections in
<a href=
"gitweb.html">gitweb(
1)
</a> manpage.
</p></div>
857 <div class=
"dlist"><dl>
863 Absolute filesystem path which will be prepended to project path;
864 the path to repository is
<code>$projectroot/$project
</code>. Set to
865 <code>$GITWEB_PROJECTROOT
</code> during installation. This variable has to be
866 set correctly for gitweb to find repositories.
868 <div class=
"paragraph"><p>For example, if
<code>$projectroot
</code> is set to
"/srv/git" by putting the following
869 in gitweb config file:
</p></div>
870 <div class=
"listingblock">
871 <div class=
"content">
872 <pre><code>our $projectroot =
"/srv/git";
</code></pre>
874 <div class=
"paragraph"><p>then
</p></div>
875 <div class=
"listingblock">
876 <div class=
"content">
877 <pre><code>http://git.example.com/gitweb.cgi?p=foo/bar.git
</code></pre>
879 <div class=
"paragraph"><p>and its path_info based equivalent
</p></div>
880 <div class=
"listingblock">
881 <div class=
"content">
882 <pre><code>http://git.example.com/gitweb.cgi/foo/bar.git
</code></pre>
884 <div class=
"paragraph"><p>will map to the path
<code>/srv/git/foo/bar.git
</code> on the filesystem.
</p></div>
891 Name of a plain text file listing projects, or a name of directory
892 to be scanned for projects.
894 <div class=
"paragraph"><p>Project list files should list one project per line, with each line
895 having the following format
</p></div>
896 <div class=
"listingblock">
897 <div class=
"content">
898 <pre><code><URI-encoded filesystem path to repository
> SP
<URI-encoded repository owner
></code></pre>
900 <div class=
"paragraph"><p>The default value of this variable is determined by the
<code>GITWEB_LIST
</code>
901 makefile variable at installation time. If this variable is empty, gitweb
902 will fall back to scanning the
<code>$projectroot
</code> directory for repositories.
</p></div>
909 If
<code>$projects_list
</code> variable is unset, gitweb will recursively
910 scan filesystem for Git repositories. The
<code>$project_maxdepth
</code>
911 is used to limit traversing depth, relative to
<code>$projectroot
</code>
912 (starting point); it means that directories which are further
913 from
<code>$projectroot
</code> than
<code>$project_maxdepth
</code> will be skipped.
915 <div class=
"paragraph"><p>It is purely performance optimization, originally intended for MacOS X,
916 where recursive directory traversal is slow. Gitweb follows symbolic
917 links, but it detects cycles, ignoring any duplicate files and directories.
</p></div>
918 <div class=
"paragraph"><p>The default value of this variable is determined by the build-time
919 configuration variable
<code>GITWEB_PROJECT_MAXDEPTH
</code>, which defaults to
927 Show repository only if this file exists (in repository). Only
928 effective if this variable evaluates to true. Can be set when
929 building gitweb by setting
<code>GITWEB_EXPORT_OK
</code>. This path is
930 relative to
<code>GIT_DIR
</code>. git-daemon[
1] uses
<em>git-daemon-export-ok
</em>,
931 unless started with
<code>--export-all
</code>. By default this variable is
932 not set, which means that this feature is turned off.
940 Function used to determine which repositories should be shown.
941 This subroutine should take one parameter, the full path to
942 a project, and if it returns true, that project will be included
943 in the projects list and can be accessed through gitweb as long
944 as it fulfills the other requirements described by $export_ok,
945 $projects_list, and $projects_maxdepth. Example:
947 <div class=
"listingblock">
948 <div class=
"content">
949 <pre><code>our $export_auth_hook = sub { return -e
"$_[0]/git-daemon-export-ok"; };
</code></pre>
951 <div class=
"paragraph"><p>though the above might be done by using
<code>$export_ok
</code> instead
</p></div>
952 <div class=
"listingblock">
953 <div class=
"content">
954 <pre><code>our $export_ok =
"git-daemon-export-ok";
</code></pre>
956 <div class=
"paragraph"><p>If not set (default), it means that this feature is disabled.
</p></div>
957 <div class=
"paragraph"><p>See also more involved example in
"Controlling access to Git repositories"
958 subsection on
<a href=
"gitweb.html">gitweb(
1)
</a> manpage.
</p></div>
965 Only allow viewing of repositories also shown on the overview page.
966 This for example makes
<code>$export_ok
</code> file decide if repository is
967 available and not only if it is shown. If
<code>$projects_list
</code> points to
968 file with list of project, only those repositories listed would be
969 available for gitweb. Can be set during building gitweb via
970 <code>GITWEB_STRICT_EXPORT
</code>. By default this variable is not set, which
971 means that you can directly access those repositories that are hidden
972 from projects list page (e.g. the are not listed in the $projects_list
979 <h3 id=
"_finding_files">Finding files
</h3>
980 <div class=
"paragraph"><p>The following configuration variables tell gitweb where to find files.
981 The values of these variables are paths on the filesystem.
</p></div>
982 <div class=
"dlist"><dl>
988 Core git executable to use. By default set to
<code>$GIT_BINDIR/git
</code>, which
989 in turn is by default set to
<code>$(bindir)/git
</code>. If you use Git installed
990 from a binary package, you should usually set this to
"/usr/bin/git".
991 This can just be
"git" if your web server has a sensible PATH; from
992 security point of view it is better to use absolute path to git binary.
993 If you have multiple Git versions installed it can be used to choose
994 which one to use. Must be (correctly) set for gitweb to be able to
1003 File to use for (filename extension based) guessing of MIME types before
1004 trying
<code>/etc/mime.types
</code>.
<strong>NOTE
</strong> that this path, if relative, is taken
1005 as relative to the current Git repository, not to CGI script. If unset,
1006 only
<code>/etc/mime.types
</code> is used (if present on filesystem). If no mimetypes
1007 file is found, mimetype guessing based on extension of file is disabled.
1011 <dt class=
"hdlist1">
1016 Path to the highlight executable to use (it must be the one from
1017 <a href=
"http://andre-simon.de/zip/download.php">http://andre-simon.de/zip/download.php
</a> due to assumptions about parameters and output).
1018 By default set to
<em>highlight
</em>; set it to full path to highlight
1019 executable if it is not installed on your web server
’s PATH.
1020 Note that
<em>highlight
</em> feature must be set for gitweb to actually
1021 use syntax highlighting.
1023 <div class=
"paragraph"><p><strong>NOTE
</strong>: for a file to be highlighted, its syntax type must be detected
1024 and that syntax must be supported by
"highlight". The default syntax
1025 detection is minimal, and there are many supported syntax types with no
1026 detection by default. There are three options for adding syntax
1027 detection. The first and second priority are
<code>%highlight_basename
</code> and
1028 <code>%highlight_ext
</code>, which detect based on basename (the full filename, for
1029 example
"Makefile") and extension (for example
"sh"). The keys of these
1030 hashes are the basename and extension, respectively, and the value for a
1031 given key is the name of the syntax to be passed via
<code>--syntax
<syntax
></code>
1032 to
"highlight". The last priority is the
"highlight" configuration of
1033 <code>Shebang
</code> regular expressions to detect the language based on the first
1034 line in the file, (for example, matching the line
"#!/bin/bash"). See
1035 the highlight documentation and the default config at
1036 /etc/highlight/filetypes.conf for more details.
</p></div>
1037 <div class=
"paragraph"><p>For example if repositories you are hosting use
"phtml" extension for
1038 PHP files, and you want to have correct syntax-highlighting for those
1039 files, you can add the following to gitweb configuration:
</p></div>
1040 <div class=
"listingblock">
1041 <div class=
"content">
1042 <pre><code>our %highlight_ext;
1043 $highlight_ext{'phtml'} = 'php';
</code></pre>
1049 <h3 id=
"_links_and_their_targets">Links and their targets
</h3>
1050 <div class=
"paragraph"><p>The configuration variables described below configure some of gitweb links:
1051 their target and their look (text or image), and where to find page
1052 prerequisites (stylesheet, favicon, images, scripts). Usually they are left
1053 at their default values, with the possible exception of
<code>@stylesheets
</code>
1055 <div class=
"dlist"><dl>
1056 <dt class=
"hdlist1">
1061 List of URIs of stylesheets (relative to the base URI of a page). You
1062 might specify more than one stylesheet, for example to use
"gitweb.css"
1063 as base with site specific modifications in a separate stylesheet
1064 to make it easier to upgrade gitweb. For example, you can add
1065 a
<code>site
</code> stylesheet by putting
1067 <div class=
"listingblock">
1068 <div class=
"content">
1069 <pre><code>push @stylesheets,
"gitweb-site.css";
</code></pre>
1071 <div class=
"paragraph"><p>in the gitweb config file. Those values that are relative paths are
1072 relative to base URI of gitweb.
</p></div>
1073 <div class=
"paragraph"><p>This list should contain the URI of gitweb
’s standard stylesheet. The default
1074 URI of gitweb stylesheet can be set at build time using the
<code>GITWEB_CSS
</code>
1075 makefile variable. Its default value is
<code>static/gitweb.css
</code>
1076 (or
<code>static/gitweb.min.css
</code> if the
<code>CSSMIN
</code> variable is defined,
1077 i.e. if CSS minifier is used during build).
</p></div>
1078 <div class=
"paragraph"><p><strong>Note
</strong>: there is also a legacy
<code>$stylesheet
</code> configuration variable, which was
1079 used by older gitweb. If
<code>$stylesheet
</code> variable is defined, only CSS stylesheet
1080 given by this variable is used by gitweb.
</p></div>
1082 <dt class=
"hdlist1">
1087 Points to the location where you put
<em>git-logo.png
</em> on your web
1088 server, or to be more the generic URI of logo,
72x27 size). This image
1089 is displayed in the top right corner of each gitweb page and used as
1090 a logo for the Atom feed. Relative to the base URI of gitweb (as a path).
1091 Can be adjusted when building gitweb using
<code>GITWEB_LOGO
</code> variable
1092 By default set to
<code>static/git-logo.png
</code>.
1095 <dt class=
"hdlist1">
1100 Points to the location where you put
<em>git-favicon.png
</em> on your web
1101 server, or to be more the generic URI of favicon, which will be served
1102 as
"image/png" type. Web browsers that support favicons (website icons)
1103 may display them in the browser
’s URL bar and next to the site name in
1104 bookmarks. Relative to the base URI of gitweb. Can be adjusted at
1105 build time using
<code>GITWEB_FAVICON
</code> variable.
1106 By default set to
<code>static/git-favicon.png
</code>.
1109 <dt class=
"hdlist1">
1114 Points to the location where you put
<em>gitweb.js
</em> on your web server,
1115 or to be more generic the URI of JavaScript code used by gitweb.
1116 Relative to the base URI of gitweb. Can be set at build time using
1117 the
<code>GITWEB_JS
</code> build-time configuration variable.
1119 <div class=
"paragraph"><p>The default value is either
<code>static/gitweb.js
</code>, or
<code>static/gitweb.min.js
</code> if
1120 the
<code>JSMIN
</code> build variable was defined, i.e. if JavaScript minifier was used
1121 at build time.
<strong>Note
</strong> that this single file is generated from multiple
1122 individual JavaScript
"modules".
</p></div>
1124 <dt class=
"hdlist1">
1129 Target of the home link on the top of all pages (the first part of view
1130 "breadcrumbs"). By default it is set to the absolute URI of a current page
1131 (to the value of
<code>$my_uri
</code> variable, or to
"/" if
<code>$my_uri
</code> is undefined
1132 or is an empty string).
1135 <dt class=
"hdlist1">
1140 Label for the
"home link" at the top of all pages, leading to
<code>$home_link
</code>
1141 (usually the main gitweb page, which contains the projects list). It is
1142 used as the first component of gitweb
’s
"breadcrumb trail":
1143 <code><home link
> /
<project
> /
<action
></code>. Can be set at build time using
1144 the
<code>GITWEB_HOME_LINK_STR
</code> variable. By default it is set to
"projects",
1145 as this link leads to the list of projects. Another popular choice is to
1146 set it to the name of site. Note that it is treated as raw HTML so it
1147 should not be set from untrusted sources.
1150 <dt class=
"hdlist1">
1155 Additional links to be added to the start of the breadcrumb trail before
1156 the home link, to pages that are logically
"above" the gitweb projects
1157 list, such as the organization and department which host the gitweb
1158 server. Each element of the list is a reference to an array, in which
1159 element
0 is the link text (equivalent to
<code>$home_link_str
</code>) and element
1160 1 is the target URL (equivalent to
<code>$home_link
</code>).
1162 <div class=
"paragraph"><p>For example, the following setting produces a breadcrumb trail like
1163 "home / dev / projects / …" where
"projects" is the home link.
</p></div>
1164 <div class=
"listingblock">
1165 <div class=
"content">
1166 <pre><code> our @extra_breadcrumbs = (
1167 [ 'home' =
> 'https://www.example.org/' ],
1168 [ 'dev' =
> 'https://dev.example.org/' ],
1172 <dt class=
"hdlist1">
1175 <dt class=
"hdlist1">
1180 URI and label (title) for the Git logo link (or your site logo,
1181 if you chose to use different logo image). By default, these both
1182 refer to Git homepage,
<a href=
"https://git-scm.com">https://git-scm.com
</a>; in the past, they pointed
1183 to Git documentation at
<a href=
"https://www.kernel.org">https://www.kernel.org
</a>.
1189 <h3 id=
"_changing_gitweb_8217_s_look">Changing gitweb
’s look
</h3>
1190 <div class=
"paragraph"><p>You can adjust how pages generated by gitweb look using the variables described
1191 below. You can change the site name, add common headers and footers for all
1192 pages, and add a description of this gitweb installation on its main page
1193 (which is the projects list page), etc.
</p></div>
1194 <div class=
"dlist"><dl>
1195 <dt class=
"hdlist1">
1200 Name of your site or organization, to appear in page titles. Set it
1201 to something descriptive for clearer bookmarks etc. If this variable
1202 is not set or is, then gitweb uses the value of the
<code>SERVER_NAME
</code>
1203 <code>CGI
</code> environment variable, setting site name to
"$SERVER_NAME Git",
1204 or
"Untitled Git" if this variable is not set (e.g. if running gitweb
1205 as standalone script).
1207 <div class=
"paragraph"><p>Can be set using the
<code>GITWEB_SITENAME
</code> at build time. Unset by default.
</p></div>
1209 <dt class=
"hdlist1">
1210 $site_html_head_string
1214 HTML snippet to be included in the
<head
> section of each page.
1215 Can be set using
<code>GITWEB_SITE_HTML_HEAD_STRING
</code> at build time.
1219 <dt class=
"hdlist1">
1224 Name of a file with HTML to be included at the top of each page.
1225 Relative to the directory containing the
<em>gitweb.cgi
</em> script.
1226 Can be set using
<code>GITWEB_SITE_HEADER
</code> at build time. No default
1230 <dt class=
"hdlist1">
1235 Name of a file with HTML to be included at the bottom of each page.
1236 Relative to the directory containing the
<em>gitweb.cgi
</em> script.
1237 Can be set using
<code>GITWEB_SITE_FOOTER
</code> at build time. No default
1241 <dt class=
"hdlist1">
1246 Name of a HTML file which, if it exists, is included on the
1247 gitweb projects overview page (
"projects_list" view). Relative to
1248 the directory containing the gitweb.cgi script. Default value
1249 can be adjusted during build time using
<code>GITWEB_HOMETEXT
</code> variable.
1250 By default set to
<em>indextext.html
</em>.
1253 <dt class=
"hdlist1">
1254 $projects_list_description_width
1258 The width (in characters) of the
"Description" column of the projects list.
1259 Longer descriptions will be truncated (trying to cut at word boundary);
1260 the full description is available in the
<em>title
</em> attribute (usually shown on
1261 mouseover). The default is
25, which might be too small if you
1262 use long project descriptions.
1265 <dt class=
"hdlist1">
1266 $default_projects_order
1270 Default value of ordering of projects on projects list page, which
1271 means the ordering used if you don
’t explicitly sort projects list
1272 (if there is no
"o" CGI query parameter in the URL). Valid values
1273 are
"none" (unsorted),
"project" (projects are by project name,
1274 i.e. path to repository relative to
<code>$projectroot
</code>),
"descr"
1275 (project description),
"owner", and
"age" (by date of most current
1278 <div class=
"paragraph"><p>Default value is
"project". Unknown value means unsorted.
</p></div>
1283 <h3 id=
"_changing_gitweb_8217_s_behavior">Changing gitweb
’s behavior
</h3>
1284 <div class=
"paragraph"><p>These configuration variables control
<em>internal
</em> gitweb behavior.
</p></div>
1285 <div class=
"dlist"><dl>
1286 <dt class=
"hdlist1">
1287 $default_blob_plain_mimetype
1291 Default mimetype for the blob_plain (raw) view, if mimetype checking
1292 doesn
’t result in some other type; by default
"text/plain".
1293 Gitweb guesses mimetype of a file to display based on extension
1294 of its filename, using
<code>$mimetypes_file
</code> (if set and file exists)
1295 and
<code>/etc/mime.types
</code> files (see
<strong>mime.types
</strong>(
5) manpage; only
1296 filename extension rules are supported by gitweb).
1299 <dt class=
"hdlist1">
1300 $default_text_plain_charset
1304 Default charset for text files. If this is not set, the web server
1305 configuration will be used. Unset by default.
1308 <dt class=
"hdlist1">
1313 Gitweb assumes this charset when a line contains non-UTF-
8 characters.
1314 The fallback decoding is used without error checking, so it can be even
1315 "utf-8". The value must be a valid encoding; see the
<strong>Encoding::Supported
</strong>(
3pm)
1316 man page for a list. The default is
"latin1", aka.
"iso-8859-1".
1319 <dt class=
"hdlist1">
1324 Rename detection options for git-diff and git-diff-tree. The default is
1325 ('-M'); set it to ('-C') or ('-C', '-C') to also detect copies,
1326 or set it to () i.e. empty list if you don
’t want to have renames
1329 <div class=
"paragraph"><p><strong>Note
</strong> that rename and especially copy detection can be quite
1330 CPU-intensive. Note also that non Git tools can have problems with
1331 patches generated with options mentioned above, especially when they
1332 involve file copies ('-C') or criss-cross renames ('-B').
</p></div>
1337 <h3 id=
"_some_optional_features_and_policies">Some optional features and policies
</h3>
1338 <div class=
"paragraph"><p>Most of features are configured via
<code>%feature
</code> hash; however some of extra
1339 gitweb features can be turned on and configured using variables described
1340 below. This list beside configuration variables that control how gitweb
1341 looks does contain variables configuring administrative side of gitweb
1342 (e.g. cross-site scripting prevention; admittedly this as side effect
1343 affects how
"summary" pages look like, or load limiting).
</p></div>
1344 <div class=
"dlist"><dl>
1345 <dt class=
"hdlist1">
1350 List of Git base URLs. These URLs are used to generate URLs
1351 describing from where to fetch a project, which are shown on
1352 project summary page. The full fetch URL is
"<code>$git_base_url/$project</code>",
1353 for each element of this list. You can set up multiple base URLs
1354 (for example one for
<code>git://
</code> protocol, and one for
<code>http://
</code>
1357 <div class=
"paragraph"><p>Note that per repository configuration can be set in
<code>$GIT_DIR/cloneurl
</code>
1358 file, or as values of multi-value
<code>gitweb.url
</code> configuration variable in
1359 project config. Per-repository configuration takes precedence over value
1360 composed from
<code>@git_base_url_list
</code> elements and project name.
</p></div>
1361 <div class=
"paragraph"><p>You can setup one single value (single entry/item in this list) at build
1362 time by setting the
<code>GITWEB_BASE_URL
</code> build-time configuration variable.
1363 By default it is set to (), i.e. an empty list. This means that gitweb
1364 would not try to create project URL (to fetch) from project name.
</p></div>
1366 <dt class=
"hdlist1">
1367 $projects_list_group_categories
1371 Whether to enable the grouping of projects by category on the project
1372 list page. The category of a project is determined by the
1373 <code>$GIT_DIR/category
</code> file or the
<code>gitweb.category
</code> variable in each
1374 repository
’s configuration. Disabled by default (set to
0).
1377 <dt class=
"hdlist1">
1378 $project_list_default_category
1382 Default category for projects for which none is specified. If this is
1383 set to the empty string, such projects will remain uncategorized and
1384 listed at the top, above categorized projects. Used only if project
1385 categories are enabled, which means if
<code>$projects_list_group_categories
</code>
1386 is true. By default set to
"" (empty string).
1389 <dt class=
"hdlist1">
1394 If true, some gitweb features are disabled to prevent content in
1395 repositories from launching cross-site scripting (XSS) attacks. Set this
1396 to true if you don
’t trust the content of your repositories.
1397 False by default (set to
0).
1400 <dt class=
"hdlist1">
1405 Used to set the maximum load that we will still respond to gitweb queries.
1406 If the server load exceeds this value then gitweb will return
1407 "503 Service Unavailable" error. The server load is taken to be
0
1408 if gitweb cannot determine its value. Currently it works only on Linux,
1409 where it uses
<code>/proc/loadavg
</code>; the load there is the number of active
1410 tasks on the system
 — processes that are actually running
 — averaged
1411 over the last minute.
1413 <div class=
"paragraph"><p>Set
<code>$maxload
</code> to undefined value (
<code>undef
</code>) to turn this feature off.
1414 The default value is
300.
</p></div>
1416 <dt class=
"hdlist1">
1421 If true, omit the column with date of the most current commit on the
1422 projects list page. It can save a bit of I/O and a fork per repository.
1425 <dt class=
"hdlist1">
1430 If true prevents displaying information about repository owner.
1433 <dt class=
"hdlist1">
1438 If this is set to code reference, it will be run once for each request.
1439 You can set parts of configuration that change per session this way.
1440 For example, one might use the following code in a gitweb configuration
1443 <div class=
"listingblock">
1444 <div class=
"content">
1445 <pre><code>our $per_request_config = sub {
1446 $ENV{GL_USER} = $cgi-
>remote_user ||
"gitweb";
1449 <div class=
"paragraph"><p>If
<code>$per_request_config
</code> is not a code reference, it is interpreted as boolean
1450 value. If it is true gitweb will process config files once per request,
1451 and if it is false gitweb will process config files only once, each time it
1452 is executed. True by default (set to
1).
</p></div>
1453 <div class=
"paragraph"><p><strong>NOTE
</strong>:
<code>$my_url
</code>,
<code>$my_uri
</code>, and
<code>$base_url
</code> are overwritten with their default
1454 values before every request, so if you want to change them, be sure to set
1455 this variable to true or a code reference effecting the desired changes.
</p></div>
1456 <div class=
"paragraph"><p>This variable matters only when using persistent web environments that
1457 serve multiple requests using single gitweb instance, like mod_perl,
1458 FastCGI or Plackup.
</p></div>
1463 <h3 id=
"_other_variables">Other variables
</h3>
1464 <div class=
"paragraph"><p>Usually you should not need to change (adjust) any of configuration
1465 variables described below; they should be automatically set by gitweb to
1466 correct value.
</p></div>
1467 <div class=
"dlist"><dl>
1468 <dt class=
"hdlist1">
1473 Gitweb version, set automatically when creating gitweb.cgi from
1474 gitweb.perl. You might want to modify it if you are running modified
1477 <div class=
"listingblock">
1478 <div class=
"content">
1479 <pre><code>our $version .=
" with caching";
</code></pre>
1481 <div class=
"paragraph"><p>if you run modified version of gitweb with caching support. This variable
1482 is purely informational, used e.g. in the
"generator" meta header in HTML
1485 <dt class=
"hdlist1">
1488 <dt class=
"hdlist1">
1493 Full URL and absolute URL of the gitweb script;
1494 in earlier versions of gitweb you might have need to set those
1495 variables, but now there should be no need to do it. See
1496 <code>$per_request_config
</code> if you need to set them still.
1499 <dt class=
"hdlist1">
1504 Base URL for relative URLs in pages generated by gitweb,
1505 (e.g.
<code>$logo
</code>,
<code>$favicon
</code>,
<code>@stylesheets
</code> if they are relative URLs),
1506 needed and used
<em><base
href=
"$base_url"></em> only for URLs with nonempty
1507 PATH_INFO. Usually gitweb sets its value correctly,
1508 and there is no need to set this variable, e.g. to $my_uri or
"/".
1509 See
<code>$per_request_config
</code> if you need to override it anyway.
1517 <h2 id=
"_configuring_gitweb_features">CONFIGURING GITWEB FEATURES
</h2>
1518 <div class=
"sectionbody">
1519 <div class=
"paragraph"><p>Many gitweb features can be enabled (or disabled) and configured using the
1520 <code>%feature
</code> hash. Names of gitweb features are keys of this hash.
</p></div>
1521 <div class=
"paragraph"><p>Each
<code>%feature
</code> hash element is a hash reference and has the following
1522 structure:
</p></div>
1523 <div class=
"listingblock">
1524 <div class=
"content">
1525 <pre><code>"<feature_name>" =
> {
1526 "sub" =
> <feature-sub (subroutine)
>,
1527 "override" =
> <allow-override (boolean)
>,
1528 "default" =
> [
<options
>... ]
1531 <div class=
"paragraph"><p>Some features cannot be overridden per project. For those
1532 features the structure of appropriate
<code>%feature
</code> hash element has a simpler
1534 <div class=
"listingblock">
1535 <div class=
"content">
1536 <pre><code>"<feature_name>" =
> {
1538 "default" =
> [
<options
>... ]
1541 <div class=
"paragraph"><p>As one can see it lacks the 'sub' element.
</p></div>
1542 <div class=
"paragraph"><p>The meaning of each part of feature configuration is described
1544 <div class=
"dlist"><dl>
1545 <dt class=
"hdlist1">
1550 List (array reference) of feature parameters (if there are any),
1551 used also to toggle (enable or disable) given feature.
1553 <div class=
"paragraph"><p>Note that it is currently
<strong>always
</strong> an array reference, even if
1554 feature doesn
’t accept any configuration parameters, and 'default'
1555 is used only to turn it on or off. In such case you turn feature on
1556 by setting this element to
<code>[
1]
</code>, and torn it off by setting it to
1557 <code>[
0]
</code>. See also the passage about the
"blame" feature in the
"Examples"
1559 <div class=
"paragraph"><p>To disable features that accept parameters (are configurable), you
1560 need to set this element to empty list i.e.
<code>[]
</code>.
</p></div>
1562 <dt class=
"hdlist1">
1567 If this field has a true value then the given feature is
1568 overridable, which means that it can be configured
1569 (or enabled/disabled) on a per-repository basis.
1571 <div class=
"paragraph"><p>Usually given
"<feature>" is configurable via the
<code>gitweb.
<feature
></code>
1572 config variable in the per-repository Git configuration file.
</p></div>
1573 <div class=
"paragraph"><p><strong>Note
</strong> that no feature is overridable by default.
</p></div>
1575 <dt class=
"hdlist1">
1580 Internal detail of implementation. What is important is that
1581 if this field is not present then per-repository override for
1582 given feature is not supported.
1584 <div class=
"paragraph"><p>You wouldn
’t need to ever change it in gitweb config file.
</p></div>
1588 <h3 id=
"_features_in_code_feature_code">Features in
<code>%feature
</code></h3>
1589 <div class=
"paragraph"><p>The gitweb features that are configurable via
<code>%feature
</code> hash are listed
1590 below. This should be a complete list, but ultimately the authoritative
1591 and complete list is in gitweb.cgi source code, with features described
1592 in the comments.
</p></div>
1593 <div class=
"dlist"><dl>
1594 <dt class=
"hdlist1">
1599 Enable the
"blame" and
"blame_incremental" blob views, showing for
1600 each line the last commit that modified it; see
<a href=
"git-blame.html">git-blame(
1)
</a>.
1601 This can be very CPU-intensive and is therefore disabled by default.
1603 <div class=
"paragraph"><p>This feature can be configured on a per-repository basis via
1604 repository
’s
<code>gitweb.blame
</code> configuration variable (boolean).
</p></div>
1606 <dt class=
"hdlist1">
1611 Enable and configure the
"snapshot" action, which allows user to
1612 download a compressed archive of any tree or commit, as produced
1613 by
<a href=
"git-archive.html">git-archive(
1)
</a> and possibly additionally compressed.
1614 This can potentially generate high traffic if you have large project.
1616 <div class=
"paragraph"><p>The value of 'default' is a list of names of snapshot formats,
1617 defined in
<code>%known_snapshot_formats
</code> hash, that you wish to offer.
1618 Supported formats include
"tgz",
"tbz2",
"txz" (gzip/bzip2/xz
1619 compressed tar archive) and
"zip"; please consult gitweb sources for
1620 a definitive list. By default only
"tgz" is offered.
</p></div>
1621 <div class=
"paragraph"><p>This feature can be configured on a per-repository basis via
1622 repository
’s
<code>gitweb.snapshot
</code> configuration variable, which contains
1623 a comma separated list of formats or
"none" to disable snapshots.
1624 Unknown values are ignored.
</p></div>
1626 <dt class=
"hdlist1">
1631 Enable grep search, which lists the files in currently selected
1632 tree (directory) containing the given string; see
<a href=
"git-grep.html">git-grep(
1)
</a>.
1633 This can be potentially CPU-intensive, of course. Enabled by default.
1635 <div class=
"paragraph"><p>This feature can be configured on a per-repository basis via
1636 repository
’s
<code>gitweb.grep
</code> configuration variable (boolean).
</p></div>
1638 <dt class=
"hdlist1">
1643 Enable the so called pickaxe search, which will list the commits
1644 that introduced or removed a given string in a file. This can be
1645 practical and quite faster alternative to
"blame" action, but it is
1646 still potentially CPU-intensive. Enabled by default.
1648 <div class=
"paragraph"><p>The pickaxe search is described in
<a href=
"git-log.html">git-log(
1)
</a> (the
1649 description of
<code>-S
<string
></code> option, which refers to pickaxe entry in
1650 <a href=
"gitdiffcore.html">gitdiffcore(
7)
</a> for more details).
</p></div>
1651 <div class=
"paragraph"><p>This feature can be configured on a per-repository basis by setting
1652 repository
’s
<code>gitweb.pickaxe
</code> configuration variable (boolean).
</p></div>
1654 <dt class=
"hdlist1">
1659 Enable showing size of blobs (ordinary files) in a
"tree" view, in a
1660 separate column, similar to what
<code>ls -l
</code> does; see description of
1661 <code>-l
</code> option in
<a href=
"git-ls-tree.html">git-ls-tree(
1)
</a> manpage. This costs a bit of
1662 I/O. Enabled by default.
1664 <div class=
"paragraph"><p>This feature can be configured on a per-repository basis via
1665 repository
’s
<code>gitweb.showSizes
</code> configuration variable (boolean).
</p></div>
1667 <dt class=
"hdlist1">
1672 Enable and configure
"patches" view, which displays list of commits in email
1673 (plain text) output format; see also
<a href=
"git-format-patch.html">git-format-patch(
1)
</a>.
1674 The value is the maximum number of patches in a patchset generated
1675 in
"patches" view. Set the
<em>default
</em> field to a list containing single
1676 item of or to an empty list to disable patch view, or to a list
1677 containing a single negative number to remove any limit.
1678 Default value is
16.
1680 <div class=
"paragraph"><p>This feature can be configured on a per-repository basis via
1681 repository
’s
<code>gitweb.patches
</code> configuration variable (integer).
</p></div>
1683 <dt class=
"hdlist1">
1688 Avatar support. When this feature is enabled, views such as
1689 "shortlog" or
"commit" will display an avatar associated with
1690 the email of each committer and author.
1692 <div class=
"paragraph"><p>Currently available providers are
<strong>"gravatar"</strong> and
<strong>"picon"</strong>.
1693 Only one provider at a time can be selected (
<em>default
</em> is one element list).
1694 If an unknown provider is specified, the feature is disabled.
1695 <strong>Note
</strong> that some providers might require extra Perl packages to be
1696 installed; see
<code>gitweb/INSTALL
</code> for more details.
</p></div>
1697 <div class=
"paragraph"><p>This feature can be configured on a per-repository basis via
1698 repository
’s
<code>gitweb.avatar
</code> configuration variable.
</p></div>
1699 <div class=
"paragraph"><p>See also
<code>%avatar_size
</code> with pixel sizes for icons and avatars
1700 (
"default" is used for one-line like
"log" and
"shortlog",
"double"
1701 is used for two-line like
"commit",
"commitdiff" or
"tag"). If the
1702 default font sizes or lineheights are changed (e.g. via adding extra
1703 CSS stylesheet in
<code>@stylesheets
</code>), it may be appropriate to change
1704 these values.
</p></div>
1706 <dt class=
"hdlist1">
1711 Redact e-mail addresses from the generated HTML, etc. content.
1712 This obscures e-mail addresses retrieved from the author/committer
1713 and comment sections of the Git log.
1714 It is meant to hinder web crawlers that harvest and abuse addresses.
1715 Such crawlers may not respect robots.txt.
1716 Note that users and user tools also see the addresses as redacted.
1717 If Gitweb is not the final step in a workflow then subsequent steps
1718 may misbehave because of the redacted information they receive.
1719 Disabled by default.
1722 <dt class=
"hdlist1">
1727 Server-side syntax highlight support in
"blob" view. It requires
1728 <code>$highlight_bin
</code> program to be available (see the description of
1729 this variable in the
"Configuration variables" section above),
1730 and therefore is disabled by default.
1732 <div class=
"paragraph"><p>This feature can be configured on a per-repository basis via
1733 repository
’s
<code>gitweb.highlight
</code> configuration variable (boolean).
</p></div>
1735 <dt class=
"hdlist1">
1740 Enable displaying remote heads (remote-tracking branches) in the
"heads"
1741 list. In most cases the list of remote-tracking branches is an
1742 unnecessary internal private detail, and this feature is therefore
1743 disabled by default.
<a href=
"git-instaweb.html">git-instaweb(
1)
</a>, which is usually used
1744 to browse local repositories, enables and uses this feature.
1746 <div class=
"paragraph"><p>This feature can be configured on a per-repository basis via
1747 repository
’s
<code>gitweb.remote_heads
</code> configuration variable (boolean).
</p></div>
1750 <div class=
"paragraph"><p>The remaining features cannot be overridden on a per project basis.
</p></div>
1751 <div class=
"dlist"><dl>
1752 <dt class=
"hdlist1">
1757 Enable text search, which will list the commits which match author,
1758 committer or commit text to a given string; see the description of
1759 <code>--author
</code>,
<code>--committer
</code> and
<code>--grep
</code> options in
<a href=
"git-log.html">git-log(
1)
</a>
1760 manpage. Enabled by default.
1762 <div class=
"paragraph"><p>Project specific override is not supported.
</p></div>
1764 <dt class=
"hdlist1">
1769 If this feature is enabled, gitweb considers projects in
1770 subdirectories of project root (basename) to be forks of existing
1771 projects. For each project
<code>$projname.git
</code>, projects in the
1772 <code>$projname/
</code> directory and its subdirectories will not be
1773 shown in the main projects list. Instead, a '+' mark is shown
1774 next to
<code>$projname
</code>, which links to a
"forks" view that lists all
1775 the forks (all projects in
<code>$projname/
</code> subdirectory). Additionally
1776 a
"forks" view for a project is linked from project summary page.
1778 <div class=
"paragraph"><p>If the project list is taken from a file (
<code>$projects_list
</code> points to a
1779 file), forks are only recognized if they are listed after the main project
1780 in that file.
</p></div>
1781 <div class=
"paragraph"><p>Project specific override is not supported.
</p></div>
1783 <dt class=
"hdlist1">
1788 Insert custom links to the action bar of all project pages. This
1789 allows you to link to third-party scripts integrating into gitweb.
1791 <div class=
"paragraph"><p>The
"default" value consists of a list of triplets in the form
1792 ‘(
"<label>",
"<link>",
"<position>")` where
"position" is the label
1793 after which to insert the link,
"link" is a format string where
<code>%n
</code>
1794 expands to the project name,
<code>%f
</code> to the project path within the
1795 filesystem (i.e.
"$projectroot/$project"),
<code>%h
</code> to the current hash
1796 ('h
’ gitweb parameter) and
‘%b` to the current hash base
1797 ('hb
’ gitweb parameter);
‘%%` expands to '%
’.
</p></div>
1798 <div class=
"paragraph"><p>For example, at the time this page was written, the
<a href=
"https://repo.or.cz">https://repo.or.cz
</a>
1799 Git hosting site set it to the following to enable graphical log
1800 (using the third party tool
<strong>git-browser
</strong>):
</p></div>
1801 <div class=
"listingblock">
1802 <div class=
"content">
1803 <pre><code>$feature{'actions'}{'default'} =
1804 [ ('graphiclog', '/git-browser/by-commit.html?r=%n', 'summary')];
</code></pre>
1806 <div class=
"paragraph"><p>This adds a link titled
"graphiclog" after the
"summary" link, leading to
1807 <code>git-browser
</code> script, passing
<code>r=
<project
></code> as a query parameter.
</p></div>
1808 <div class=
"paragraph"><p>Project specific override is not supported.
</p></div>
1810 <dt class=
"hdlist1">
1815 Enable displaying how much time and how many Git commands it took to
1816 generate and display each page in the page footer (at the bottom of
1817 page). For example the footer might contain:
"This page took 6.53325
1818 seconds and 13 Git commands to generate." Disabled by default.
1820 <div class=
"paragraph"><p>Project specific override is not supported.
</p></div>
1822 <dt class=
"hdlist1">
1827 Enable and configure the ability to change a common time zone for dates
1828 in gitweb output via JavaScript. Dates in gitweb output include
1829 authordate and committerdate in
"commit",
"commitdiff" and
"log"
1830 views, and taggerdate in
"tag" view. Enabled by default.
1832 <div class=
"paragraph"><p>The value is a list of three values: a default time zone (for if the client
1833 hasn
’t selected some other time zone and saved it in a cookie), a name of cookie
1834 where to store selected time zone, and a CSS class used to mark up
1835 dates for manipulation. If you want to turn this feature off, set
"default"
1836 to empty list:
<code>[]
</code>.
</p></div>
1837 <div class=
"paragraph"><p>Typical gitweb config files will only change starting (default) time zone,
1838 and leave other elements at their default values:
</p></div>
1839 <div class=
"listingblock">
1840 <div class=
"content">
1841 <pre><code>$feature{'javascript-timezone'}{'default'}[
0] =
"utc";
</code></pre>
1843 <div class=
"paragraph"><p>The example configuration presented here is guaranteed to be backwards
1844 and forward compatible.
</p></div>
1845 <div class=
"paragraph"><p>Time zone values can be
"local" (for local time zone that browser uses),
"utc"
1846 (what gitweb uses when JavaScript or this feature is disabled), or numerical
1847 time zones in the form of
"+/-HHMM", such as
"+0200".
</p></div>
1848 <div class=
"paragraph"><p>Project specific override is not supported.
</p></div>
1850 <dt class=
"hdlist1">
1855 List of additional directories under
"refs" which are going to
1856 be used as branch refs. For example if you have a gerrit setup
1857 where all branches under refs/heads/ are official,
1858 push-after-review ones and branches under refs/sandbox/,
1859 refs/wip and refs/other are user ones where permissions are
1860 much wider, then you might want to set this variable as
1863 <div class=
"listingblock">
1864 <div class=
"content">
1865 <pre><code>$feature{'extra-branch-refs'}{'default'} =
1866 ['sandbox', 'wip', 'other'];
</code></pre>
1868 <div class=
"paragraph"><p>This feature can be configured on per-repository basis after setting
1869 $feature{
<em>extra-branch-refs
</em>}{
<em>override
</em>} to true, via repository
’s
1870 <code>gitweb.extraBranchRefs
</code> configuration variable, which contains a
1871 space separated list of refs. An example:
</p></div>
1872 <div class=
"listingblock">
1873 <div class=
"content">
1875 extraBranchRefs = sandbox wip other
</code></pre>
1877 <div class=
"paragraph"><p>The gitweb.extraBranchRefs is actually a multi-valued configuration
1878 variable, so following example is also correct and the result is the
1879 same as of the snippet above:
</p></div>
1880 <div class=
"listingblock">
1881 <div class=
"content">
1883 extraBranchRefs = sandbox
1884 extraBranchRefs = wip other
</code></pre>
1886 <div class=
"paragraph"><p>It is an error to specify a ref that does not pass
"git check-ref-format"
1887 scrutiny. Duplicated values are filtered.
</p></div>
1894 <h2 id=
"_examples">EXAMPLES
</h2>
1895 <div class=
"sectionbody">
1896 <div class=
"paragraph"><p>To enable blame, pickaxe search, and snapshot support (allowing
"tar.gz" and
1897 "zip" snapshots), while allowing individual projects to turn them off, put
1898 the following in your GITWEB_CONFIG file:
</p></div>
1899 <div class=
"listingblock">
1900 <div class=
"content">
1901 <pre><code>$feature{'blame'}{'default'} = [
1];
1902 $feature{'blame'}{'override'} =
1;
1904 $feature{'pickaxe'}{'default'} = [
1];
1905 $feature{'pickaxe'}{'override'} =
1;
1907 $feature{'snapshot'}{'default'} = ['zip', 'tgz'];
1908 $feature{'snapshot'}{'override'} =
1;
</code></pre>
1910 <div class=
"paragraph"><p>If you allow overriding for the snapshot feature, you can specify which
1911 snapshot formats are globally disabled. You can also add any command-line
1912 options you want (such as setting the compression level). For instance, you
1913 can disable Zip compressed snapshots and set
<strong>gzip
</strong>(
1) to run at level
6 by
1914 adding the following lines to your gitweb configuration file:
</p></div>
1915 <div class=
"literalblock">
1916 <div class=
"content">
1917 <pre><code>$known_snapshot_formats{'zip'}{'disabled'} =
1;
1918 $known_snapshot_formats{'tgz'}{'compressor'} = ['gzip','-
6'];
</code></pre>
1923 <h2 id=
"_bugs">BUGS
</h2>
1924 <div class=
"sectionbody">
1925 <div class=
"paragraph"><p>Debugging would be easier if the fallback configuration file
1926 (
<code>/etc/gitweb.conf
</code>) and environment variable to override its location
1927 (
<em>GITWEB_CONFIG_SYSTEM
</em>) had names reflecting their
"fallback" role.
1928 The current names are kept to avoid breaking working setups.
</p></div>
1932 <h2 id=
"_environment">ENVIRONMENT
</h2>
1933 <div class=
"sectionbody">
1934 <div class=
"paragraph"><p>The location of per-instance and system-wide configuration files can be
1935 overridden using the following environment variables:
</p></div>
1936 <div class=
"dlist"><dl>
1937 <dt class=
"hdlist1">
1942 Sets location of per-instance configuration file.
1945 <dt class=
"hdlist1">
1946 GITWEB_CONFIG_SYSTEM
1950 Sets location of fallback system-wide configuration file.
1951 This file is read only if per-instance one does not exist.
1954 <dt class=
"hdlist1">
1955 GITWEB_CONFIG_COMMON
1959 Sets location of common system-wide configuration file.
1966 <h2 id=
"_files">FILES
</h2>
1967 <div class=
"sectionbody">
1968 <div class=
"dlist"><dl>
1969 <dt class=
"hdlist1">
1974 This is default name of per-instance configuration file. The
1975 format of this file is described above.
1978 <dt class=
"hdlist1">
1983 This is default name of fallback system-wide configuration
1984 file. This file is used only if per-instance configuration
1985 variable is not found.
1988 <dt class=
"hdlist1">
1989 /etc/gitweb-common.conf
1993 This is default name of common system-wide configuration
2001 <h2 id=
"_see_also">SEE ALSO
</h2>
2002 <div class=
"sectionbody">
2003 <div class=
"paragraph"><p><a href=
"gitweb.html">gitweb(
1)
</a>,
<a href=
"git-instaweb.html">git-instaweb(
1)
</a></p></div>
2004 <div class=
"paragraph"><p><em>gitweb/README
</em>,
<em>gitweb/INSTALL
</em></p></div>
2008 <h2 id=
"_git">GIT
</h2>
2009 <div class=
"sectionbody">
2010 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
2014 <div id=
"footnotes"><hr /></div>
2016 <div id=
"footer-text">
2018 2023-
12-
18 14:
49:
41 PST