Move gitwebUrl to gerrit.config

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-06-01 09:35:41 -07:00
parent 0d3ecff6b2
commit d7ba11f55f
6 changed files with 35 additions and 32 deletions

View File

@@ -309,6 +309,20 @@ unused mapped spaces fast enough.
Default on JGit is false. Although potentially slower, it yields
much more predictable behavior.
Section gitweb[[section_gitweb]]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See also link:config-gitweb.html[Gitweb Integration].
gitweb.url::
+
Optional URL of an affiliated gitweb service. Defines the
web location where a `gitweb.cgi` is installed to browse
`'$git_base_path'` and the repositories it contains.
+
Gerrit appends any necessary query arguments onto the end of this URL.
For example, "?p=$project.git;h=$commit".
Section sshd
~~~~~~~~~~~~
@@ -437,12 +451,6 @@ Gerrit knows about and can process changes for. A project
entity in Gerrit maps to a local Git repository by creating
the path string `"$\{git_pase_path}/$\{project_name}.git"`.
gitweb_url::
+
Optional URL of an affiliated gitweb service.
+
* link:config-gitweb.html[Gitweb Integration]
git_daemon_url::
+
Optional base URL for repositories available over the anonymous git

View File

@@ -4,34 +4,19 @@ Gerrit2 - Gitweb Integration
Gerrit2 can generate hyperlinks to gitweb, allowing users to jump
from Gerrit content to the same information, but shown by gitweb.
To enable the gitweb integration, update `system_config.gitweb_url`
with the URL of your gitweb CGI.
To enable the gitweb integration, set gitweb.url with the URL of
your gitweb CGI.
The CGI's `$projectroot` should be `'$git_base_path'`, or a fairly
current replica. If a replica is being used, ensure it uses a full
mirror, so the `refs/changes/*` namespace is available.
====
UPDATE system_config SET gitweb_url='http://example.com/gitweb.cgi'
git config --file=$site_path/gerrit.config gitweb.url http://example.com/gitweb.cgi
====
After updating `system_config`, the Gerrit server must be restarted
and clients must reload the host page to see the change.
Configurable Parameters
-----------------------
Some columns in the `system_config` table may be set to control
how Gerrit interacts with gitweb.
gitweb_url
~~~~~~~~~~
Defines the web location where a `gitweb.cgi` is installed to browse
`'$git_base_path'` and the repositories it contains.
Gerrit appends any necessary query arguments onto the end of this URL.
For example, "?p=$project.git;h=$commit".
After updating `'$site_path'/gerrit.config`, the Gerrit server must
be restarted and clients must reload the host page to see the change.
Access Control
--------------
@@ -48,6 +33,11 @@ If your repository set is large and you are expecting a lot
of users, you may want to look at the caching forks used by
high-traffic sites like kernel.org or repo.or.cz.
See Also
--------
* link:config-gerrit.html#section_gitweb[Section gitweb]
GERRIT
------
Part of link:index.html[Gerrit Code Review]

View File

@@ -87,10 +87,6 @@ public final class SystemConfig {
@Column(notNull = false)
public String canonicalUrl;
/** Optional URL of a gitweb installation to also view changes through. */
@Column(notNull = false)
public String gitwebUrl;
/**
* Optional URL of the anonymous git daemon for project access.
* <p>

View File

@@ -66,6 +66,7 @@ public class ConvertSystemConfig {
contactstore(config, rs);
user(config, rs);
auth(config, rs);
gitweb(config, rs);
}
private static void sshd(RepositoryConfig config, ResultSet rs)
@@ -109,6 +110,11 @@ public class ConvertSystemConfig {
}
}
private static void gitweb(RepositoryConfig config, ResultSet rs)
throws SQLException {
copy(config, "gitweb", "url", rs, "gitweb_url");
}
private static void copy(RepositoryConfig config, String section, String key,
ResultSet rs, String colName) throws SQLException {
final String value = rs.getString(colName);

View File

@@ -670,8 +670,10 @@ public class GerritServer {
r.setUseRepoDownload(sConfig.useRepoDownload);
r.setUseContactInfo(getContactStoreURL() != null);
r.setLoginType(getLoginType());
if (sConfig.gitwebUrl != null) {
r.setGitwebLink(new GitwebLink(sConfig.gitwebUrl));
final String gitwebUrl = getGerritConfig().getString("gitweb", null, "url");
if (gitwebUrl != null) {
r.setGitwebLink(new GitwebLink(gitwebUrl));
}
for (final ApprovalCategory c : db.approvalCategories().all()) {

View File

@@ -6,6 +6,7 @@ ALTER TABLE system_config DROP COLUMN contact_store_url;
ALTER TABLE system_config DROP COLUMN contact_store_appsec;
ALTER TABLE system_config DROP COLUMN gerrit_git_name;
ALTER TABLE system_config DROP COLUMN gerrit_git_email;
ALTER TABLE system_config DROP COLUMN gitweb_url;
ALTER TABLE system_config DROP COLUMN email_format;
ALTER TABLE system_config DROP COLUMN login_type;
ALTER TABLE system_config DROP COLUMN login_http_header;