|
| 1 | +# GitBlit plugin |
| 2 | + |
| 3 | +This plugin integrates [GitBlit](https://github.com/gitblit/gitblit) _${GitBlit-Version}_ as a repository browser into [Gerrit](https://code.google.com/p/gerrit/), |
| 4 | +with full SSO through Gerrit. |
| 5 | + |
| 6 | +* License: [Apache Public License 2.0](http://www.apache.org/licenses/LICENSE-2.0) |
| 7 | +* [Home page](https://gerrit.googlesource.com/plugins/gitblit/+/refs/heads/master/README.md) |
| 8 | +* Installed plugin version: _${pom.version}_ |
| 9 | + |
| 10 | +# Configuration |
| 11 | + |
| 12 | +There are two different configurations: one for Gerrit so it knows how to generate links that will be processed by the plugin, and |
| 13 | +an optional GitBlit configuration for the plugin itself. |
| 14 | + |
| 15 | +## Gerrit configuration |
| 16 | + |
| 17 | +In Gerrit's `gerrit.config`, define the `[gitweb]` section as follows: |
| 18 | + |
| 19 | + [gitweb] |
| 20 | + type = custom |
| 21 | + url = plugins/@PLUGIN@/ |
| 22 | + linkname = browse |
| 23 | + project = summary/?r=${project} |
| 24 | + revision = commit/?r=${project}&h=${commit} |
| 25 | + branch = log/?r=${project}&h=${branch} |
| 26 | + filehistory = history/?f=\${file}&r=${project}&h=${branch} |
| 27 | + file = blob/?r=${project}&h=${commit}&f=\${file} |
| 28 | + roottree = tree/?r=${project}&h=${commit} |
| 29 | + |
| 30 | +This is normally done automatically if you add the plugin and run through `java -jar gerrit.war init -d site_path`, but you can also |
| 31 | +add this manually to Gerrit's config file. The `linkname` can be adapted to your taste. |
| 32 | + |
| 33 | +### Configuring the top menu |
| 34 | + |
| 35 | +This plugin adds a "GitBlit" top menu to Gerrit, and also a new sub-menu item to the "Projects" top menu. Since v2.11 of this plugin, the link |
| 36 | +texts for all sub-menu items can be configured to your taste in a `[plugin "@PLUGIN@"]` section in your `gerrit.config`. If the section is not present, |
| 37 | +or some values in that section are not defined, the plugin uses built-in default texts. The default configuration would correspond to |
| 38 | + |
| 39 | + [plugin "@PLUGIN@"] |
| 40 | + repositories = Repositories |
| 41 | + activity = Activity |
| 42 | + documentation = Documentation |
| 43 | + search = |
| 44 | + browse = Browse |
| 45 | + |
| 46 | +The first four are sub-menu items of the "GitBlit" top menu, the last one is a new "browse" sub-menu item in Gerrit's "Projects" menu that is shown |
| 47 | +for Gerrit's "current" project (since v2.11). |
| 48 | + |
| 49 | +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 |
| 50 | +your projects. |
| 51 | + |
| 52 | +## GitBlit configuration |
| 53 | + |
| 54 | +The plugin includes in the JAR a minimal default configuration to make GitBlit act only as a repository viewer. You can provide your own |
| 55 | +customized [`gitblit.properties`](http://gitblit.com/properties.html) file located in Gerrit's `$GERRIT_SITE/etc` directory. |
| 56 | +The `$GERRIT_SITE/etc/gitblit.properties` takes precedence over the pre-defined configuration settings. |
| 57 | + |
| 58 | +P.S. The following two GitBlit properties are not configurable as changing them would break the plugin functionality: |
| 59 | + |
| 60 | +- git.repositoriesFolder is hardcoded to point to Gerrit repositories directory |
| 61 | +- realm.userService is hardcoded to resolve GitBlit users using Gerrit authentication realm |
| 62 | + |
| 63 | +Additionally the GitBlit ticket service is not available as would not make sense when used in a read only |
| 64 | +repository viewer. |
| 65 | + |
| 66 | +The built-in configuration is archived in the GitBlit source repository. The latest version on master is |
| 67 | +[`gitblit.properties`](https://gerrit.googlesource.com/plugins/gitblit/+/master/src/main/resources/gitblit.properties). |
| 68 | + |
| 69 | +# Issue tracking |
| 70 | + |
| 71 | +Report bugs or make feature requests at the [Gerrit issue tracker](https://code.google.com/p/gerrit/issues/list). |
| 72 | + |
| 73 | +<hr style="color: #C0C0C0; background-color: #C0C0C0; border-color: #C0C0C0; height: 2px;" /> |
| 74 | +<div style="float:right;"> |
| 75 | +<a href="https://gerrit-review.googlesource.com/#/admin/projects/plugins/gitblit,dashboards" target="_blank">GitBlit plugin ${pom.version}</a> |
| 76 | +</div> |
0 commit comments