Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Orion/How Tos/Using Gerrit in Orion"
(→Configure the Gerrit remote (Option 2): update screen shots for gerrit) |
|||
(21 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | {{Warning|This page is outdated|It will be replaced by a user-help page in Orion (Work in progress). For the moment you can find the page in the orion git repository [http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/tree/bundles/org.eclipse.orion.client.help/web/helpContent/Orion%20User%20Guide/Git%20User%20Guide.md?h{{=}}gheorghe/gitDoc Git User Guide.md] or browse it online on GitHub: [https://github.com/eclipse/orion.client/blob/master/bundles/org.eclipse.orion.client.help/web/helpContent/Orion%20User%20Guide/Git%20User%20Guide.md#working-with-gerrit Git User Guide > Working with Gerrit]}} | ||
+ | |||
= Introduction = | = Introduction = | ||
This How To makes a few assumptions: | This How To makes a few assumptions: | ||
− | # That you have already configured the Git repository you wish to use | + | # That you have already configured the Git repository you wish to use Gerrit with, and that Gerrit has been enabled on the repository. If you have not cloned a repository yet, try viewing the How To page for [[Orion/How Tos/Working with git|working with Git]] |
# That you are working with the Orion repositories, as all of the screen shots and examples will mention those repositories exclusively. If you are not trying to set up Gerrit for the Orion repositories, the steps will be generally the same but the URLs will differ. | # That you are working with the Orion repositories, as all of the screen shots and examples will mention those repositories exclusively. If you are not trying to set up Gerrit for the Orion repositories, the steps will be generally the same but the URLs will differ. | ||
# That you have a valid Eclipse.org log-in and will not be using anonymous access to Gerrit | # That you have a valid Eclipse.org log-in and will not be using anonymous access to Gerrit | ||
− | = | + | = Get the Gerrit information = |
To use Gerrit you have to set up another remote for your repository that points to the Gerrit instance. | To use Gerrit you have to set up another remote for your repository that points to the Gerrit instance. | ||
− | In this example we will be adding a remote for the [ | + | In this example we will be adding a remote for the [http://git.eclipse.org/c/platform/eclipse.platform.git/ Eclipse platform repository]. |
The first step is to find the project in Gerrit so we can determine what its URL is. To do this go to the | The first step is to find the project in Gerrit so we can determine what its URL is. To do this go to the | ||
− | [https://git.eclipse.org/r/#/admin/projects/ Gerrit projects page] and filter using <code> | + | [https://git.eclipse.org/r/#/admin/projects/ Gerrit projects page] and filter using <code>eclipse.platform</code>, then select the 'eclipse.platform' project. |
− | On the [https://git.eclipse.org/r/#/admin/projects/ | + | On the [https://git.eclipse.org/r/#/admin/projects/platform/eclipse.platform Eclipse platform project page] there will be different URL information for how to set up your remote. At the top of the information page you will see a URL like <code>ssh://<userid>@git.eclipse.org:29418/platform/eclipse.platform</code>. Copy this URL, we will use it in the next step. |
− | + | = Use Gerrit to clone the repo (Option 1) = | |
− | + | ||
− | + | ||
− | + | If you use the Gerrit URL to clone the repo, then origin can also access Gerrit. You can then set the property ''gerrit.createChangeId'' to ''true'' and Orion will generate a Change-Id footer for all commits you create. It will also enable a ''Push for Review'' option under the ''Push'' button dropdown. | |
+ | |||
+ | Currently not working, {bug|424313} - PushJob ignores configured pushRefSpec | ||
+ | |||
+ | = Configure the Gerrit remote (Option 2) = | ||
+ | |||
+ | {{Warning|This page is outdated|It will be replaced by a user-help page in Orion (Work in progress). For the moment you can find the page in the orion git repository [http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/tree/bundles/org.eclipse.orion.client.help/web/helpContent/Orion%20User%20Guide/Git%20User%20Guide.md?h{{=}}gheorghe/gitDoc Git User Guide.md] or browse it online on GitHub: [https://github.com/eclipse/orion.client/blob/gheorghe/gitDoc/bundles/org.eclipse.orion.client.help/web/helpContent/Orion%20User%20Guide/Git%20User%20Guide.md#working-with-gerrit Git User Guide > Working with Gerrit]}} | ||
− | |||
Once you are logged into the Orion client, use the navigation menu to open the Git repositories view. Assuming have already cloned the Orion client repository, lets add the Gerrit remote. | Once you are logged into the Orion client, use the navigation menu to open the Git repositories view. Assuming have already cloned the Orion client repository, lets add the Gerrit remote. | ||
Line 27: | Line 32: | ||
# Expand that section and click the '''New Remote''' button on the right hand side | # Expand that section and click the '''New Remote''' button on the right hand side | ||
# In the '''Name''' box supply a meaningful name, such as <code>gerrit</code> | # In the '''Name''' box supply a meaningful name, such as <code>gerrit</code> | ||
− | # In the URL box enter the URL | + | # In the URL box enter the URL from the Gerrit project page, in this case it will be <code>ssh://git.eclipse.org:29418/platform/eclipse.platform</code><br>[[Image:New-gerrit-remote-platform.png|The new remote entry example for the Eclipse platform]] |
− | [[Image:gerrit | + | |
# Press '''Submit''' and you should see your new Gerrit remote | # Press '''Submit''' and you should see your new Gerrit remote | ||
− | # In the '''Configuration''' section select the <code> | + | # In the '''Configuration''' section select the <code>View all</code> link on the right hand side |
# Find the '''remote.gerrit.fetch''' setting and change it to be <code>refs/notes/*:refs/notes/*</code> | # Find the '''remote.gerrit.fetch''' setting and change it to be <code>refs/notes/*:refs/notes/*</code> | ||
− | # Using the '''New Configuration Entry''' button on the right hand side and the new entry <code>remote.gerrit.push</code> and set its value to be <code>HEAD:refs/for/master</code> | + | # Using the '''New Configuration Entry''' button on the right hand side and the new entry <code>remote.gerrit.push</code> and set its value to be <code>HEAD:refs/for/master</code><br>[[Image:New-config-entry-gerrit.png|The new gerrit push configuration entry]] |
− | [[Image: | + | |
# Head back to the '''Remotes''' section and do a pull on the <code>gerrit</code> remote to make sure it is working. | # Head back to the '''Remotes''' section and do a pull on the <code>gerrit</code> remote to make sure it is working. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Orion|How To]] | [[Category:Orion|How To]] | ||
[[Category:Orion/How_To|Git]] | [[Category:Orion/How_To|Git]] |
Latest revision as of 12:18, 5 July 2017
Contents
Introduction
This How To makes a few assumptions:
- That you have already configured the Git repository you wish to use Gerrit with, and that Gerrit has been enabled on the repository. If you have not cloned a repository yet, try viewing the How To page for working with Git
- That you are working with the Orion repositories, as all of the screen shots and examples will mention those repositories exclusively. If you are not trying to set up Gerrit for the Orion repositories, the steps will be generally the same but the URLs will differ.
- That you have a valid Eclipse.org log-in and will not be using anonymous access to Gerrit
Get the Gerrit information
To use Gerrit you have to set up another remote for your repository that points to the Gerrit instance.
In this example we will be adding a remote for the Eclipse platform repository.
The first step is to find the project in Gerrit so we can determine what its URL is. To do this go to the
Gerrit projects page and filter using eclipse.platform
, then select the 'eclipse.platform' project.
On the Eclipse platform project page there will be different URL information for how to set up your remote. At the top of the information page you will see a URL like ssh://<userid>@git.eclipse.org:29418/platform/eclipse.platform
. Copy this URL, we will use it in the next step.
Use Gerrit to clone the repo (Option 1)
If you use the Gerrit URL to clone the repo, then origin can also access Gerrit. You can then set the property gerrit.createChangeId to true and Orion will generate a Change-Id footer for all commits you create. It will also enable a Push for Review option under the Push button dropdown.
Currently not working, {bug|424313} - PushJob ignores configured pushRefSpec
Configure the Gerrit remote (Option 2)
Once you are logged into the Orion client, use the navigation menu to open the Git repositories view. Assuming have already cloned the Orion client repository, lets add the Gerrit remote.
- Select the Orion client repository, taking you to the information page with a section called Remotes
- Expand that section and click the New Remote button on the right hand side
- In the Name box supply a meaningful name, such as
gerrit
- In the URL box enter the URL from the Gerrit project page, in this case it will be
ssh://git.eclipse.org:29418/platform/eclipse.platform
- Press Submit and you should see your new Gerrit remote
- In the Configuration section select the
View all
link on the right hand side - Find the remote.gerrit.fetch setting and change it to be
refs/notes/*:refs/notes/*
- Using the New Configuration Entry button on the right hand side and the new entry
remote.gerrit.push
and set its value to beHEAD:refs/for/master
- Head back to the Remotes section and do a pull on the
gerrit
remote to make sure it is working.