Skip to content

Latest commit

 

History

History
97 lines (70 loc) · 5.59 KB

index.md

File metadata and controls

97 lines (70 loc) · 5.59 KB

GitBlit plugin

This plugin integrates GitBlit 1.7.1 as a repository browser into Gerrit, with full SSO through Gerrit.

For a list of contributors, see at GitHub.

This is a privately maintained fork of the official Gerrit-Gitblit plugin. Please report any issues with this plugin at the GitHub issue tracker.

For the official plugin, see the repository at Google Code.

Configuration

The plugin in configured in Gerrit's global configuration file gerrit.config. As of v2.16.171.0, this plugin does not use the [gitweb] section anymore. Configuration is done in the [plugin "gitblit"] section.

This plugin adds a "GitBlit" top menu to Gerrit. Since v2.11.162.2 of this plugin, the link texts for all sub-menu items can be configured to your taste in a [plugin "gitblit"] section in your gerrit.config. If the section is not present, or some values in that section are not defined, the plugin uses built-in default texts. The default configuration would correspond to

[plugin "gitblit"]
        repositories = Repositories
        activity = Activity
        documentation = Documentation
        search =
        linkname = Gitblit

The first four are sub-menu items of the "GitBlit" top menu, the last one is the link text shown on links to Gitblit for individual files or in the project list.

The "search" sub-menu item is by default not set and will thus not be shown. Setting it makes only sense if you enable GitBlit indexing on some of your projects. See the GitBlit documentation for more information on that.

GitBlit configuration

The plugin includes a minimal default configuration to make GitBlit act only as a repository viewer. You can augment that with further customizations in a normal gitblit.properties file located in Gerrit's $GERRIT_SITE/etc directory. The built-in configuration, which ensures that GitBlit is configured as a viewer only, always takes precedence. Also, the git.repositoriesFolder property is always set to Gerrit's git directory at $GERRIT_SITE/git.

To see the built-in configuration, access it at gitblit.properties.

By default, the built-in configuration does allow anonymous browsing, subject to the repository and ref-level access restrictions defined in Gerrit. If you want to lock the GitBlit plugin to allow only logged-in users to browse, set in $GERRIT_SITE/etc/gitblit.properties the key web.authenticateViewPages = true. This is the only key of the built-in configuration that you can override.

GitBlit's ticket service, fan-out service, and its plugin mechanism are disabled in this plugin, as is ssh access through GitBlit since Gerrit already provides that. Also disabled is Gitblit's LFS implementation.

The GitBlit ${baseFolder} is the plugin's data directory provided by Gerrit at $GERRIT_SITE/data/gitblit/.

Up to and including v2.11.162.1 of this plugin, GitBlit's ${baseFolder} was at $GERRIT_SITE/etc/gitblit/. If you upgraded from that or an earlier version and do have data in $GERRIT_SITE/etc/gitblit/, move it over to the new place. The directory $GERRIT_SITE/etc/gitblit/ can then be removed.

GitBlit settings specific to this plugin

web.maxCommitDiffContext = [1 .. 10]

Since 2.12.162.2. In a GitBlit commit diff, diffs of all changed files in a commit are shown on one page. This setting defines how many context lines shall be shown shown at most in such diffs. The default is 10, but can be reduced further through this property in your gitblit.properties file.

If the Gerrit preference setting for the number of context lines in diffs is lower than this GitBlit setting, the Gerrit setting is taken.

For single-file diffs, the plugin respects the Gerrit preference setting of the currently logged-in user for the number of context lines in a diff. For non-logged-in users, the GitBlit default of 3 context lines applies. (The Gerrit default is 10.)

Issue tracking

Report bugs or make feature requests at the GitHub issue tracker.

Known issues

  • For logged-in users, their preference page ("my profile") is accessible but non-functional. Per-user GitBlit preferences cannot be saved. There are no plans to fix this; GitBlit uses a plain file-based mechanism to store such user preferences anyway, which won't scale well for large user bases.

  • I have never tried Lucene indexing of repositories through GitBlit. It's functionality I have never needed, and I don't plan to ever do something about it in case it doesn't work.


<script type="text/javascript" src="version_check.js"></script>