Gitweb 集成
Gerrit 代码审查可以管理和生成指向 gitweb 的超链接,允许用户从 Gerrit 内容跳转到相同信息,但由 gitweb 显示。
内部/托管 gitweb
在内部配置中,Gerrit 检查请求并强制执行其项目级访问控制,并在用户被授权查看页面时直接执行 gitweb.cgi。
要启用内部配置,设置 gitweb.cgi 路径为安装的 CGI。默认为,这是 Linux 发行版上'gitweb'包的常见安装路径:/usr/lib/cgi-bin/gitweb.cgi。
git config -f $site_path/etc/gerrit.config gitweb.type gitweb
git config -f $site_path/etc/gerrit.config gitweb.cgi /usr/lib/cgi-bin/gitweb.cgi
git config -f $site_path/etc/gerrit.config --unset gitweb.url
或者,如果 Gerrit 通过反向代理送达,它可以为 gitweb 的链接生成不同的 URL(需要在网页服务器上重写)。这允许用于以与 Gerrit 实例不同的 URL 提供 gitweb。要启用此功能,请设置 gitweb.url。
git config -f $site_path/etc/gerrit.config gitweb.type gitweb
git config -f $site_path/etc/gerrit.config gitweb.cgi /usr/lib/cgi-bin/gitweb.cgi
git config -f $site_path/etc/gerrit.config gitweb.url /pretty/path/to/gitweb
更新后,Gerrit 服务器必须重启,客户端必须重新加载主页才能查看变更。修改的文件为 $site_path/etc/gerrit.config。
配置
大部分 gitweb 配置文件都是自动处理的。站点特定的覆盖可以放置在 $site_path/etc/gitweb_config.perl 中,因为该文件加载为生成配置文件的一部分。
标志与 CSS
如果包管理器安装了 CGI 正在使用时,库存的 CSS 和标志文件将从以下提供:/usr/lib/cgi-bin/gitweb.cgi 或 /usr/share/gitweb/var/www。
否则,Gerrit 期待 gitweb.css 和 git-logo.png 与 CGI 脚本同一个目录。这与默认源代码发行版,以及大多数自定义安装一致。

