forked from tmate/tmate.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgerrit.html
85 lines (53 loc) · 3.7 KB
/
gerrit.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
layout: documentation
subtitle: SubGit Plugin for Gerrit
---
<div class="wrapper">
{% capture content %}
> **INFORMATION**<br>
[Gerrit](https://www.gerritcodereview.com/) does not trigger standard pre-receive and post-receive hooks when one pushes new commits to Git repository. SubGit heavily relies on those hooks in order to maintain reliable two-way mirror. On this page you can download SubGit plugin for Gerrit that emulates pre-receive hook behavior.
### 1. Download SubGit Plugin for Gerrit
<p>Version: <strong>1.0.0-EAP4</strong>, published on: <strong>August 18, 2016:</strong></p>
<center>
<p><a href="http://old.subgit.com/download/subgit-gerrit-plugin-1.0.0-EAP4.jar" class="button_orange" style="margin:-10px 0 -10px 20px !important;">subgit-gerrit-plugin-1.0.0-EAP4.jar</a></p>
</center>
<p>MD5 checksum: 3902cf714c856524e8f4815ad70c00f3<br>
Compatible Gerrit versions: 2.9.x, 2.10.x, 2.11.x and 2.12.x.</p>
### 2. Install SubGit Plugin into Gerrit
<p>Move downloaded file into GERRIT_SITE/plugins/ directory and make sure the plugin becomes enabled at Plugins | Installed:</p>
![List installed plugins]({{ site.baseurl }}/img/gerrit/101_installed_plugins.png)
If you have older version of the plugin, replace it with the newer one.
We recommend to restart Gerrit after upgrading previously installed version of the plugin.
### 3. Increase receive timeout
Set [receive.timeout](https://git.eclipse.org/r/Documentation/config-gerrit.html#receive) to 0 in [GERRIT_SITE/etc/gerrit.config](https://git.eclipse.org/r/Documentation/config-gerrit.html#_file_code_etc_gerrit_config_code) file and then restart Gerrit server:
$ git config -f GERRIT_SITE/etc/gerrit.config receive.timeout 0
$ GERRIT_SITE/bin/gerrit.sh restart
By default Gerrit may interrupt `git push` operation on timeout, setting receive.timeout to 0 forces Gerrit to wait until SubGit completes Git-SVN synchronization.
### 4. Create empty Git repository
<p>
Create empty Git repository at Projects | Create New Project:
</p>
![Create empty Git repository]({{ site.baseurl }}/img/gerrit/102_create_project.png)
### 5. Follow standard instructions
Locate repository directory of created Gerrit project:
$ ls GERRIT_SITE/git/
$ ls GERRIT_SITE/git/project.git
and follow [standard instructions]( {{ site.baseurl }}/howto.html) on establishing Git-SVN mirror with SubGit command line tool:
Run the following command to configure Git repository to mirror SVN project:
$ subgit configure --layout auto SVN_URL GERRIT_SITE/git/project.git
Above command will detect branches layout in the SVN project and generate SubGit configuration file ready for further adjustments.
You may be asked for credentials unless those are already stored in the SVN credentials cache at ~/.subversion/ directory.
Review and adjust branches mapping configuration:
$ edit GERRIT_SITE/git/project.git/subgit/config
Review and adjust Git/SVN authors mapping:
$ edit GERRIT_SITE/git/project.git/subgit/authors.txt
You may use dynamic authors mapping replacing authors.txt with a script. Script sample could be found at GERRIT_SITE/git/project.git/subgit/samples/ directory.
Run the following command to enable mirror and translate SVN revisions to Git commits:
$ subgit install GERRIT_SITE/git/project.git
As soon as initial translation is completed, Gerrit project is ready to serve users.
Commits pushed to this project will be translated to Subversion repository and SVN revisions will be translated to Git.
### 6. Get Support<a name="support"></a>
Would you have any question on using SubGit with Gerrit, don't hesitate to contact us at [support@subgit.com](mailto:support@subgit.com). We'd be glad to assist you.
{% endcapture %}
{{ content | markdownify }}
</div>