Skip to content

Commit 08934df

Browse files
committed
Adapt to Gerrit 2.16
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.
1 parent 61ad8e3 commit 08934df

File tree

21 files changed

+1193
-168
lines changed

21 files changed

+1193
-168
lines changed

docu/index.md

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ with full SSO through Gerrit.
55

66
* License: [Apache Public License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
77
* [Home page](https://github.com/tomaswolf/gerrit-gitblit-plugin)
8-
* 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>
8+
* 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>
99

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

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

18-
There are two different configurations: one for Gerrit so it knows how to generate links that will be processed by the plugin, and
19-
an optional GitBlit configuration for the plugin itself.
18+
The plugin in configured in Gerrit's global configuration file `gerrit.config`.
19+
As of v2.16.171.0, this plugin does _not_ use the `[gitweb]` section anymore.
20+
Configuration is done in the `[plugin "gitblit"]` section.
2021

21-
## Gerrit configuration
22-
23-
In Gerrit's `gerrit.config`, define the `[gitweb]` section as follows:
24-
25-
[gitweb]
26-
type = custom
27-
url = plugins/gitblit/
28-
linkname = browse
29-
project = summary/?r=${project}
30-
revision = commit/?r=${project}&h=${commit}
31-
branch = log/?r=${project}&h=${branch}
32-
filehistory = history/?f=${file}&r=${project}&h=${branch}
33-
file = blob/?r=${project}&h=${commit}&f=${file}
34-
roottree = tree/?r=${project}&h=${commit}
35-
36-
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
37-
add this manually to Gerrit's config file. The `linkname` can be adapted to your taste.
38-
39-
### Configuring the top menu
40-
41-
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
22+
This plugin adds a "GitBlit" top menu to Gerrit. Since v2.11.162.2 of this plugin, the link
4223
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,
4324
or some values in that section are not defined, the plugin uses built-in default texts. The default configuration would correspond to
4425

@@ -47,14 +28,14 @@ or some values in that section are not defined, the plugin uses built-in default
4728
activity = Activity
4829
documentation = Documentation
4930
search =
50-
browse = Browse
31+
linkname = Gitblit
5132

52-
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
53-
for Gerrit's "current" project (since v2.11.162.2).
33+
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
34+
or in the project list.
5435

5536
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
5637
your projects. See the [GitBlit documentation](http://gitblit.com/setup_lucene.html) for more information on that.
57-
38+
5839
## GitBlit configuration
5940

6041
The plugin includes a minimal default configuration to make GitBlit act only as a repository viewer. You can augment that with further
@@ -66,7 +47,7 @@ To see the built-in configuration, access it at [`gitblit.properties`](../src/ma
6647

6748
By default, the built-in configuration does allow anonymous browsing, subject to the repository and ref-level access restrictions defined in Gerrit.
6849
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
69-
`web.authenticateViewPages = true`. This is the only key of the built-in configuration that you _can_ override.
50+
`web.authenticateViewPages = true`. This is the only key of the built-in configuration that you _can_ override.
7051

7152
GitBlit's ticket service, fan-out service, and its plugin mechanism are disabled in this plugin, as is ssh access through GitBlit since Gerrit
7253
already provides that. Also disabled is Gitblit's LFS implementation.
@@ -95,7 +76,7 @@ The GitBlit `${baseFolder}` is the plugin's data directory provided by Gerrit at
9576
</p>
9677
</dd>
9778
</dl>
98-
79+
9980

10081
# Issue tracking
10182

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

11293
<hr style="color: #C0C0C0; background-color: #C0C0C0; border-color: #C0C0C0; height: 2px;" />
11394
<div style="float:right;">
114-
<a href="https://github.com/tomaswolf/gerrit-gitblit-plugin" target="_blank">GitBlit plugin 2.15.171.0-SNAPSHOT</a>
95+
<a href="https://github.com/tomaswolf/gerrit-gitblit-plugin" target="_blank">GitBlit plugin 2.16.171.1-SNAPSHOT</a>
11596
</div>
11697
<script type="text/javascript" src="version_check.js"></script>

pom.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020
<artifactId>gitblit-plugin</artifactId>
2121
<description>GitBlit for Gerrit integrated as a plugin</description>
2222
<name>Gerrit - GitBlit Plugin</name>
23-
<version>2.15.171.0-SNAPSHOT</version><!-- Gerrit API version followed by collapsed GitBlit version, followed by plugin version -->
23+
<version>2.16.171.1-SNAPSHOT</version><!-- Gerrit API version followed by collapsed GitBlit version, followed by plugin version -->
2424
<licenses>
2525
<license>
2626
<name>Apache License 2.0</name>
@@ -29,7 +29,7 @@ limitations under the License.
2929
</licenses>
3030
<properties>
3131
<Gerrit-ApiType>plugin</Gerrit-ApiType>
32-
<Gerrit-ApiVersion>2.15</Gerrit-ApiVersion>
32+
<Gerrit-ApiVersion>2.16.7</Gerrit-ApiVersion>
3333
<GitBlit-Version>1.7.1</GitBlit-Version>
3434
<Wicket-Version>1.4.22</Wicket-Version>
3535
<Gerrit-ReloadMode>restart</Gerrit-ReloadMode>
@@ -232,6 +232,8 @@ limitations under the License.
232232
<exclude>com/gitblit/models/RefModel$*.class</exclude>
233233
<exclude>com/gitblit/models/RepositoryCommit.class</exclude><!-- StackOverflowError; issue #21 -->
234234
<exclude>com/gitblit/models/RepositoryCommit$*.class</exclude>
235+
<exclude>com/gitblit/wicket/MarkupProcessor.class</exclude><!-- Use flexmark from Gerrit instead of pegdown/parboiled -->
236+
<exclude>com/gitblit/wicket/MarkupProcessor$*.class</exclude>
235237
<exclude>com/gitblit/wicket/SessionlessForm.class</exclude><!-- Non-transient logger; issue #21 -->
236238
<exclude>com/gitblit/wicket/SessionlessForm$*.class</exclude>
237239
<exclude>com/gitblit/wicket/pages/BasePage.class</exclude><!-- Gerrit footer link -->
@@ -258,6 +260,8 @@ limitations under the License.
258260
<exclude>com/gitblit/wicket/panels/LogPanel$*.class</exclude>
259261
<exclude>com/gitblit/wicket/panels/SearchPanel.class</exclude><!-- StackOverflowError; issue #21 -->
260262
<exclude>com/gitblit/wicket/panels/SearchPanel$*.class</exclude>
263+
<exclude>com/gitblit/utils/MarkdownUtils.class</exclude><!-- Use flexmark from Gerrit instead of pegdown/parboiled -->
264+
<exclude>com/gitblit/utils/MarkdownUtils$*.class</exclude>
261265
<exclude>com/gitblit/utils/MetricUtils.class</exclude><!-- Bug fix -->
262266
<exclude>com/gitblit/utils/MetricUtils$*.class</exclude>
263267
<exclude>com/gitblit/utils/GitBlitDiffFormatter.class</exclude><!-- Number of diff context lines -->
@@ -277,6 +281,8 @@ limitations under the License.
277281
<exclude>com/gitblit/utils/RefLogUtils$*.class</exclude>
278282
<exclude>com/gitblit/wicket/pages/NewRepositoryPage.class</exclude>
279283
<exclude>com/gitblit/wicket/pages/NewRepositoryPage$*.class</exclude>
284+
<exclude>com/gitblit/wicket/panels/BranchesPanel.class</exclude>
285+
<exclude>com/gitblit/wicket/panels/BranchesPanel$*.class</exclude>
280286
<exclude>com/gitblit/wicket/panels/HistoryPanel.class</exclude><!-- Also StackOverflowError; issue #21 -->
281287
<exclude>com/gitblit/wicket/panels/HistoryPanel$*.class</exclude>
282288
<exclude>com/gitblit/tickets/BranchTicketService.class</exclude>

0 commit comments

Comments
 (0)