Skip to content

Commit

Permalink
Adapt to Gerrit 2.16
Browse files Browse the repository at this point in the history
Build against Gerrit API 2.16.7. Adapt plugin sources to Gerrit API
changes.

Adapt Gitblit 1.7.1 sources to JGit 5.1.6 and to Lucene 6.6.5 used in
Gerrit 2.16.6.

Fix the links in the web UI to also work in the new PolyGerrit UI.
Remove the "Browse" menu on a "Project" page; it doesn't work anymore
in the PolyGerrit UI. (Appeared on the wrong pages in the wrong place,
and was non-functional.)

Gerrit has removed the pegdown parser for markdown files; they use
flexmark now. Gitblit uses pegdown, but re-including them from Gitblit
caused crashes when trying to parse markdown files. Rewrite two
Markdown classes in Gitblit to use flexmark instead.
  • Loading branch information
tomaswolf committed Mar 16, 2019
1 parent 61ad8e3 commit 08934df
Show file tree
Hide file tree
Showing 21 changed files with 1,193 additions and 168 deletions.
43 changes: 12 additions & 31 deletions docu/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ with full SSO through Gerrit.

* License: [Apache Public License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
* [Home page](https://github.com/tomaswolf/gerrit-gitblit-plugin)
* Installed plugin version: <em id='gerrit-gitblit-current-version'>2.15.171.0-SNAPSHOT</em> &mdash; <a id='gerrit-gitblit-version-check' style='display:none;' href='#'>Check for updates</a>
* Installed plugin version: <em id='gerrit-gitblit-current-version'>2.16.171.1-SNAPSHOT</em> &mdash; <a id='gerrit-gitblit-version-check' style='display:none;' href='#'>Check for updates</a>

For a list of contributors, see at [GitHub](https://github.com/tomaswolf/gerrit-gitblit-plugin/graphs/contributors).

Expand All @@ -15,30 +15,11 @@ This is a privately maintained fork of the official Gerrit-Gitblit plugin. Pleas
# Configuration

There are two different configurations: one for Gerrit so it knows how to generate links that will be processed by the plugin, and
an optional GitBlit configuration for the plugin itself.
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.

## Gerrit configuration

In Gerrit's `gerrit.config`, define the `[gitweb]` section as follows:

[gitweb]
type = custom
url = plugins/gitblit/
linkname = browse
project = summary/?r=${project}
revision = commit/?r=${project}&h=${commit}
branch = log/?r=${project}&h=${branch}
filehistory = history/?f=${file}&r=${project}&h=${branch}
file = blob/?r=${project}&h=${commit}&f=${file}
roottree = tree/?r=${project}&h=${commit}

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
add this manually to Gerrit's config file. The `linkname` can be adapted to your taste.

### Configuring the top menu

This plugin adds a "GitBlit" top menu to Gerrit, and also a new sub-menu item to the "Projects" top menu. Since v2.11.162.2 of this plugin, the link
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

Expand All @@ -47,14 +28,14 @@ or some values in that section are not defined, the plugin uses built-in default
activity = Activity
documentation = Documentation
search =
browse = Browse
linkname = Gitblit

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
for Gerrit's "current" project (since v2.11.162.2).
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](http://gitblit.com/setup_lucene.html) 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
Expand All @@ -66,7 +47,7 @@ To see the built-in configuration, access it at [`gitblit.properties`](../src/ma

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.
`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.
Expand Down Expand Up @@ -95,7 +76,7 @@ The GitBlit `${baseFolder}` is the plugin's data directory provided by Gerrit at
</p>
</dd>
</dl>


# Issue tracking

Expand All @@ -111,6 +92,6 @@ Report bugs or make feature requests at the [GitHub issue tracker](https://githu

<hr style="color: #C0C0C0; background-color: #C0C0C0; border-color: #C0C0C0; height: 2px;" />
<div style="float:right;">
<a href="https://github.com/tomaswolf/gerrit-gitblit-plugin" target="_blank">GitBlit plugin 2.15.171.0-SNAPSHOT</a>
<a href="https://github.com/tomaswolf/gerrit-gitblit-plugin" target="_blank">GitBlit plugin 2.16.171.1-SNAPSHOT</a>
</div>
<script type="text/javascript" src="version_check.js"></script>
10 changes: 8 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.
<artifactId>gitblit-plugin</artifactId>
<description>GitBlit for Gerrit integrated as a plugin</description>
<name>Gerrit - GitBlit Plugin</name>
<version>2.15.171.0-SNAPSHOT</version><!-- Gerrit API version followed by collapsed GitBlit version, followed by plugin version -->
<version>2.16.171.1-SNAPSHOT</version><!-- Gerrit API version followed by collapsed GitBlit version, followed by plugin version -->
<licenses>
<license>
<name>Apache License 2.0</name>
Expand All @@ -29,7 +29,7 @@ limitations under the License.
</licenses>
<properties>
<Gerrit-ApiType>plugin</Gerrit-ApiType>
<Gerrit-ApiVersion>2.15</Gerrit-ApiVersion>
<Gerrit-ApiVersion>2.16.7</Gerrit-ApiVersion>
<GitBlit-Version>1.7.1</GitBlit-Version>
<Wicket-Version>1.4.22</Wicket-Version>
<Gerrit-ReloadMode>restart</Gerrit-ReloadMode>
Expand Down Expand Up @@ -232,6 +232,8 @@ limitations under the License.
<exclude>com/gitblit/models/RefModel$*.class</exclude>
<exclude>com/gitblit/models/RepositoryCommit.class</exclude><!-- StackOverflowError; issue #21 -->
<exclude>com/gitblit/models/RepositoryCommit$*.class</exclude>
<exclude>com/gitblit/wicket/MarkupProcessor.class</exclude><!-- Use flexmark from Gerrit instead of pegdown/parboiled -->
<exclude>com/gitblit/wicket/MarkupProcessor$*.class</exclude>
<exclude>com/gitblit/wicket/SessionlessForm.class</exclude><!-- Non-transient logger; issue #21 -->
<exclude>com/gitblit/wicket/SessionlessForm$*.class</exclude>
<exclude>com/gitblit/wicket/pages/BasePage.class</exclude><!-- Gerrit footer link -->
Expand All @@ -258,6 +260,8 @@ limitations under the License.
<exclude>com/gitblit/wicket/panels/LogPanel$*.class</exclude>
<exclude>com/gitblit/wicket/panels/SearchPanel.class</exclude><!-- StackOverflowError; issue #21 -->
<exclude>com/gitblit/wicket/panels/SearchPanel$*.class</exclude>
<exclude>com/gitblit/utils/MarkdownUtils.class</exclude><!-- Use flexmark from Gerrit instead of pegdown/parboiled -->
<exclude>com/gitblit/utils/MarkdownUtils$*.class</exclude>
<exclude>com/gitblit/utils/MetricUtils.class</exclude><!-- Bug fix -->
<exclude>com/gitblit/utils/MetricUtils$*.class</exclude>
<exclude>com/gitblit/utils/GitBlitDiffFormatter.class</exclude><!-- Number of diff context lines -->
Expand All @@ -277,6 +281,8 @@ limitations under the License.
<exclude>com/gitblit/utils/RefLogUtils$*.class</exclude>
<exclude>com/gitblit/wicket/pages/NewRepositoryPage.class</exclude>
<exclude>com/gitblit/wicket/pages/NewRepositoryPage$*.class</exclude>
<exclude>com/gitblit/wicket/panels/BranchesPanel.class</exclude>
<exclude>com/gitblit/wicket/panels/BranchesPanel$*.class</exclude>
<exclude>com/gitblit/wicket/panels/HistoryPanel.class</exclude><!-- Also StackOverflowError; issue #21 -->
<exclude>com/gitblit/wicket/panels/HistoryPanel$*.class</exclude>
<exclude>com/gitblit/tickets/BranchTicketService.class</exclude>
Expand Down
Loading

0 comments on commit 08934df

Please sign in to comment.