5. Administration
   
5. Administration
This chapter provides reference information for the features of the Administration page. The Administration menu allows you to configure:
repositories
groups
AccuRev servers
For task-oriented procedural information about using this page, see Chapter 2 How to....
Opening the Administration Page
To open the Administration page, click the Administration button in the upper right corner of the GitCentric UI:
Repositories
The Repositories page (shown in the preceding screenshot) lists the repositories that are currently registered with GitCentric, and provides the ability to create a new one.
To Create a New Repository
Click the Add button to create a new repository. Procedures for using this panel are found at Create a Repository for GitCentric on page 29.
Table 1. Create repository options
Field
Description
Repository Name
Enter any valid string for the new repository. Keep it URL-friendly: just letters, digits, and dashes; no whitespace. Character length is only limited by your OS. There is no database limit on the text field.
Inherit Rights From:
By default, your repo inherits access rights from the top-level Code Review repo (“project”) named “All-projects”. However, you can specify a different repo for more control.
Only serve as parent for other repos
Use this option if you wish to create a repo with specific access rights which other repos can inherit.
To Configure an Existing Repository
1. Click on a repository name.
2. Select General, Branches, Access, or AccuRev Connector.
General
The General menu allows you to specify basic repo properties, primarily associated with Gerrit Code Review features. The various fields are described in Table 2 below.
Table 2. General Repo Settings
Setting
Description
Description
Enter a string that will appear in the “Repository Description” column of the repository lists.
Git Repository Options
Ignore Case -- When checked, sets core.ignorecase=true in the repository’s .git/config file.
Ignore Symbolic Links -- When checked, sets core.symlinks=false in the repository’s .git/config file.
Gerrit Repository Options
Submit Type -- Options that allow you to control how to merge changes:
       - Fast Forward Only
       - Merge if Necessary
       - Always Merge
       - Cherry Pick

For a discussion of these merge options, see the Project Configuration topic in the Gerrit Code Review documentation.
 
State -- Determines the accessibility of the repository:
       - Active -- Users can view, pull from, clone, or push to this repository (assuming that they have the correct access rights).
       - Read Only -- Users can see and pull from this repository (assuming that they have read permission) but cannot modify or push to it.
       - Hidden -- Only Owners can see the repo.
 
Automatically Resolves Conflicts -- By default, Code Review attempts merges only if there is no path conflict. Enabling this option forces Code Review to attempt the merge even if a path conflict occurs.
Require Change-Id in commit message -- For a discussion of Change-Ids, see the Change-Ids topic in the Gerrit Code Review documentation.
(Note: Does not apply to commits pushed directly to a branch or tag.)
Contributor Agreement
Require Signed-off-by in commit message -- For a discussion of Signed-off-by lines, see the Signed-off-by Lines topic in the Gerrit Code Review documentation.
Require a valid contributor agreement to upload -- For a discussion of valid contributor agreements, see the Contributor Agreements topic in the Gerrit Code Review documentation.
Basic Permissions
Enable Code Review -- Indicates whether or not GerritCode Review is enabled for the current repository. By default, this field is checked. See Enable/Disable Code Review on page 52 for more information.
Clone Command
Lets you quickly copy the git clone command for the current repository specified using either the HTTP or SSH protocol.
Branches
The Branches menu displays the existing branches associated with this repo, and provides the ability to delete a branch or create a new one. See Create Branches for a Repo on page 34 for a description of how to use this section.
The labels in the table are relatively self-explanatory:
Branch Name: See the Git documentation for git-check-ref-format for restrictions regarding Git branch names.
Revision: This is typically either “HEAD”, or the name of another branch, or the SHA1 hash for a specific commit.
Access
The Access menu allows you to apply GitCentric group-based permissions (ACLs) on your repositories.
These ACLs are derived from Gerrit Code Review ACLs.
Procedural information for setting ACLs is provided at Configure Access Rights (ACLs) for a Repo on page 34.
Overview and detailed information about group-based ACLs is provided at:
GitCentric Group-Based ACLs on page 10.
The Change-Ids topic in the Gerrit Code Review documentation.
1. Most ACLs take Allow, Deny, or Block. values. However, Label Verified and Label
Code-Review
take numeric values which are displayed as reviewer options on the Code Review page.
2. Each permission provides an Exclusive checkbox, which grants an exclusive ref-level access control so that only members of a specific group can perform an operation on a repository/reference pair. See the Access Controls topic in the Gerrit Code Review documentation for more information.
3. The Push and Push Annotated Tag permissions also provide a Force Push option, which allows an existing branch to be deleted. Since a force push is effectively a delete immediately followed by a create, but performed atomically on the server and logged, this option also permits forced push updates to branches. Enabling this option allows existing commits to be discarded from a project history.
AccuRev Connector
Use the AccuRev Connector menu to:
Define the mapping between branches in your Git repositories and mount points in your AccuRev streams. This procedure is described in Map a Git Branch to an AccuRev Stream on page 38.
Implement AccuRev change packages. This procedure is described in Enable and Use Change Packages on page 43.
Table 3. AccuRev Connector Settings
Section
Field
Description
AccuRev Server Connection
Server name:port
The AccuRev server and port where the stream to be mapped exists.
Username
The <gc_user> account that is a member of the group that is set to ASSIGN_USER_PRIVILEGE.
Password
The password for <gc_user>.
Associate Issues With Commit
Issue Tracking System
If you are using AccuRev change packages, use this field to specify whether you are using AccuWork or a third-party product such as Rally as your issue tracking system.
Regular Expression
If AccuRev uses an issue tracking system (either AccuWork, or a third-party system such as Rally), you can specify a regular expression here to enforce comment requirements for AccuRev change packages. Populating this field enables change package integration; leaving it blank disables it.
Branch-Stream Mappings
Branch
The branch that you want to map to an AccuRev stream.
AccuRev Depot
The AccuRev depot containing the stream that the Git branch is mapped to.
AccuRev Stream
The AccuRev stream to which the current branch is to be mapped.
Mount Point
The directory in the mapped stream to which the branch is to be synchronized. Navigate to the mount point in the graphical tree and click it to populate the Mount Point field
Initial Synchronization
This determines in which direction the first mapping will occur. If you are importing an existing repo into AccuRev, select Commit Git content to Accurev. If you are exporting the existing content of an AccuRev stream to a newly mapped repo, select Commit Accurev content to Git.
The informational line between the server and branch panels shows any existing mappings. The Status column shows Active whenever an import or export is occurring between the branch and the stream, and Idle when the synchronization is complete. Click the View Details button to display a real-time Status Monitor.
Status Monitor
The Status Monitor displays information from the GitCentric bridge for current and completed synchronizations for the selected branch-stream mapping. The Status Monitor updates every five seconds during an import or export operation.
Current Synchronization Status
The following table summarizes the values for the Current Synchronization Status fields.
Field
Description
Status
The status of the current synchronization. Values are:
Idle -- the synchronization is complete
Syncing -- the synchronization has just started
Syncing | Running for x seconds -- the synchronization is active and has been running for the time shown.
Modified By
The user who pushed the commit.
Subject
The first line of the commit message entered by the user.
SHA
The SHA associated with the commit.
Completed Synchronizations
The following table summarizes the values for the Completed Synchronizations fields.
Field
Description
Type
The task type associated with the commit. See Synchronization Type Values on page 71 for details.
Time
The time the synchronization finished.
Status
Whether the synchronization task succeeded (Pass) or failed (Fail).
Trans ID
The AccuRev transaction associated with the commit.
Message
A message indicating that the synchronization passed or why it failed.
Subject
The first line of the commit message entered by the user.
SHA
The SHA associated with the synchronization.
The Status Monitor tracks phases per commit, so if you do a multi-commit push (such as a push on an existing repository to import commit history import into AccuRev), you will see these phases repeat over and over for each commit import. The most recent completed synchronization always appears at the top of the Complete Synchronizations section.
Synchronization Type Values
The following table summarizes the values for the Type field.
Table 4. Repo Status Entries
Task Type:
Phase: 
Steps:
IncrementalImport
(16 phases total)
Initialization
1 "step"
doImport - Cleanup Workspace
doImport - Parse Commit Messages
doImport - Process Commit Diff
1 "step"
1 "step"
n "diffs"
setupPromote - processEmptyDirs
setupPromote - processMoveAside
setupPromote - checkEvilTwinForMove
setupPromote - checkUndefunctFiles
setupPromote - checkUndefunctDirs
setupPromote - checkEvilTwinFiles
setupPromote - undefunctElements
setupPromote - coFiles
setupPromote - processElinks
setupPromote - popFiles
setupPromote - moveFiles
setupPromote - deleteFiles
setupPromote - blobFiles
setupPromote - addFiles
setupPromote - keepFiles
setupPromote - linkFiles
setupPromote - mergeFiles
setupPromote - chmodFiles
setupPromote - removeOverlaps
1 "step"
1 "step"
1 "step"
1 "step"
1 "step"
1 "step"
n "elements"
1 "step"
n "elements"
1 "step"
n "elements"
1 "step"
n "blobs"
1 "step"
1 "step"
1 "step"
1 "step"
1 "step
1 "step"
doImport - Promote files
1 "step"
FullImport
(19 phases total)
Initialization
1 "step"
streamToCommit - Init
streamToCommit - Process Elements
streamToCommit - Finalize Commit
1 "step"
n "elements"
1 "step"
doImport - Cleanup Workspace
doImport - Parse Commit Messages
doImport - Process Commit Diff
1 "step"
1 "step"
n "diffs"
setupPromote - processEmptyDirs
setupPromote - processMoveAside
setupPromote - checkEvilTwinForMove
setupPromote - checkUndefunctFiles
setupPromote - checkUndefunctDirs
setupPromote - checkEvilTwinFiles
setupPromote - undefunctElements
setupPromote - coFiles
setupPromote - processElinks
setupPromote - popFiles
setupPromote - moveFiles
setupPromote - deleteFiles
setupPromote - blobFiles
setupPromote - addFiles
setupPromote - keepFiles
setupPromote - linkFiles
setupPromote - mergeFiles
setupPromote - chmodFiles
setupPromote - removeOverlaps
1 "step"
1 "step"
1 "step"
1 "step"
1 "step"
1 "step"
n "elements"
1 "step"
n "elements"
1 "step"
n "elements"
1 "step"
n "blobs"
1 "step"
1 "step"
1 "step"
1 "step"
1 "step
1 "step"
doImport - Promote files
1 "step"
FullExport
(4 phases total)
Initialization
1 "step"
streamToCommit - Init
streamToCommit - Process Elements
streamToCommit - Finalize Commit
1 "step"
n "elements"
1 "step"
IncrementalExport or
CatchUpExport
(6 phases total)
exportSingle - Init
1 "step"
doExport - getTransInfo
doExport - getChangeSet
doExport - generateFastImport
doExport - gitFastImport
1 "step"
1 "step"
n "changes"
1 "step"
exportSingle - Check null commit
1 "step"
Support for Hooks
GitCentric supports both Git and Gerrit Code Review hooks. Borland recommends using Gerrit hooks when your environment requires hooks.
For more information about Gerrit Code Review hooks, see the Gerrit Code Review documentation, here:
https://gerrit-review.googlesource.com/Documentation/config-hooks.html
Migrating Existing Git Hooks
Two Gerrit hooks, ref-update and ref-updated, are installed to <gc_home>/site/hooks and are used to migrate any Git hooks you might have created in the <gc_home>/site/git/<repoName>.git/hooks directory.
Note that the ref-update and ref-updated hooks require Perl and expect to find it at /usr/bin/perl. If you have Perl in a different location, you will need to update these hooks with the correct path.
People
Group membership determines access rights in GitCentric. Use the Groups page to list existing groups, create a new group, and to access details about an existing group.
See Manage GitCentric Groups on page 49 for information about using this page.
AccuRev Servers
The AccuRev Servers panel displays information about configured AccuRev Servers and allows you to add or remove them from GitCentric.
When you click the Add button, the Servers page expands to display the fields you use to add an AccuRev server to GitCentric. These fields are summarized in the following table:
Server Field:
Description
AccuRev Server
The host of the AccuRev server that GitCentric associates with one or more repos. This can be an IP address or the name of the server. Note that if you are connecting to a remote GitCentric server and you specify localhost, this indicates an AccuRev server on the GitCentric host, not your local machine.
Port
This is typically “5050” for most AccuRev servers, but the AccuRev administrator may have changed it to something different.
AccuRev CLI Path
The path to the AccuRev client executable installed on the GitCentric server (not the remote AccuRev server). For example:
/opt/accurev/bin/accurev.
For more information, see A Note about the CLI Path Setting on page 74.
See Add an AccuRev Server on page 46 for information about using this panel to add a server.
A Note about the CLI Path Setting
When logging into GitCentric for the first time, or when configuring an AccuRev server to work with GitCentric, you are prompted to enter a value for the “CLI Path”. This is the full path to the AccuRev client executable on the GitCentric server that should be used to communicate with the AccuRev server. For example:
<ac_home>/bin/accurev
where <ac_home> is the actual install directory, such as /opt/accurev.
The GitCentric server requires either a master AccuRev server or a compatible AccuRev client installed locally. In the case where you are using AccuRev servers of different revision levels, you must have a compatible client installed on the GitCentric server machine for each version of the AccuRev server you are using, and each must be configured with GitCentric using its specific path. For example, if you need to work with two AccuRev servers -- one running version 5.6 and one running version 5.7 -- you would need two AccuRev clients installed on the GitCentric server: one 5.6 client to work with the 5.6 server, and a separate 5.7 client to work with the 5.7 server.