The Gerrit projects must be registered with the adapter.
Before you begin
The Gerrit server is registered with the adapter.
Restriction: Check that your project name does not contain special
characters (such as a blank space or plus sign) other than a forward
slash. Other special characters might cause problems when the project
is registered or change links are created or traversed. One indication
of a problematic name is that it is displayed with double quotation
marks in the Git Project Name field of the Register
Git Project page after you choose to Register
This Project from Gerrit. Rename any projects that contain
special characters other than a forward slash before you register
the project.
About this task
You register a Gerrit project with the adapter. You must
be logged in as a Rational Team Concert™ user with administrator or project administrator
privileges. Repeat this procedure for each project you want to register.
Procedure
- Point your web browser to the Gerrit home page. For example, http://our.gerrit.server/gerrit
The Rational® Adapter for Git banner
shows. The banner is one of the Gerrit additions that you deployed
to the Gerrit server.
- From the Gerrit home page, go to a list of changes for
a project that you want to register.
- Click the Admin (Administration)
icon in the upper right portion of the banner and then click Register
This Project.
.gif)
The Register Git Project page
opens in a new web browser window.
- Confirm that the Git Project Name contains
the project name that you want to register.
- Optional: Add a summary.
- Associate the project with a Rational Team Concert project.
- Click Add.
- In the Associate Rational Team Concert Projects window,
select the check box next to the Rational Team Concert project
or projects that you want to associate this Gerrit project with.
.gif)
- Click Associate Projects.
- Click Register.
- The Gerrit project is registered with the adapter. Further
instructions direct you to configure the hooks that automate the creation
of links when commits are pushed to the registered Gerrit project.
Note the registered Gerrit project URL. The registered Gerrit project
URL is required to install and configure the receive hook for the
project.
- Configure the receive hook for your registered project.
- Click Receive Hook
- Add change request tags and separate each one with a
comma. For example, bug, task
The
adapter checks for these tags in the commit message to determine whether
a link to a work item can be created.
- Add branch names and mark them as include or exclude
to limit which branches the Git receive hook applies to. You can use
the * glob pattern to match zero or more characters in a branch name.
The adapter reviews all of the globs, and the last glob to match the
branch name applies. For example, if you have a branch
named bug180 and include bug1* and
then exclude bug18*, the adapter excludes the branch
named bug180 because the last glob to match the branch
name applies.

When a user clicks a link
from an Rational
Team Concert work item to a Gerrit change, the Git URL Format
is used to reconstruct the URL of the Gerrit change and redirect the
request. The default value is <server>#/q/<changeid>+project:<project>,n,z
Results
The Gerrit project is registered with the adapter.
What to do next
Configure the Gerrit receive hook for the Gerrit project,
see
Deploying the receive hook for Gerrit.