Jump to: navigation, search

Difference between revisions of "Orion/How Tos/Using Gerrit in Orion"

< Orion‎ | How Tos
(From the UI)
m (Introduction)
(10 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
= 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 Gerit 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 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
  
= Setting up the Gerrit remote =
+
= 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 [Orion client repository].
+
In this example we will be adding a remote for the [http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/ Orion client 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>orion</code>, then select the client project.
+
[https://git.eclipse.org/r/#/admin/projects/ Gerrit projects page] and filter using <code>orion</code>, then select the client project.  
  
On the [https://git.eclipse.org/r/#/admin/projects/orion/org.eclipse.orion.client Orion client 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://<your_user_name>@git.eclipse.org:29418/orion/org.eclipse.orion.client</code>.  
+
The project page information for all of the Orion repositories can be found in the [[#Gerrit_Project_Pages|Gerrit project pages]] section below.
  
Now with the Gerrit URL at hand, there are two ways to configure Orion:
+
On the [https://git.eclipse.org/r/#/admin/projects/orion/org.eclipse.orion.client Orion client 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://git.eclipse.org:29418/orion/org.eclipse.orion.client</code>.  Copy this URL, we will use it in the next step.
# you can use the UI from the repositories page
+
# you can use the Git command line
+
  
First we will discuss the UI way.
+
= Configure the Gerrit remote =
 
+
== From the UI ==
+
 
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 23:
 
# 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 fro the Gerrit project page, in this case it will be <code>ssh://git.eclipse.org:29418/orion/org.eclipse.orion.client</code>[[Image:gerrit-orion-remote.png|The new remote entry example for the Orion client]]
+
# In the URL box enter the URL fro the Gerrit project page, in this case it will be <code>ssh://git.eclipse.org:29418/orion/org.eclipse.orion.client</code><br>[[Image:gerrit-orion-remote.png|The new remote entry example for the Orion client]]
 
# 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>Show all</code> link on the right hand side
+
# 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:gerrit-gerrit-push-entry.png|The new gerrit push configuration entry]]
[[Image:gerrit-gerrit-push-entry.png|The new gerrit push configuration entry]]
+
 
# 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.
  
== From the command line ==
+
= Gerrit project pages =
 
+
= Pushing to Gerrit =
+
 
+
== From the UI ==
+
 
+
== From the command line ==
+
 
+
= Pulling from Gerrit =
+
 
+
== From the UI ==
+
  
== From the command line ==
+
# [https://git.eclipse.org/r/#/admin/projects/orion/org.eclipse.orion.client Orion client project page]
 +
# [https://git.eclipse.org/r/#/admin/projects/orion/org.eclipse.orion.marketplace Orion marketplace project page]
 +
# [https://git.eclipse.org/r/#/admin/projects/orion/org.eclipse.orion.server Orion server project page]
  
 
[[Category:Orion|How To]]
 
[[Category:Orion|How To]]
 
[[Category:Orion/How_To|Git]]
 
[[Category:Orion/How_To|Git]]

Revision as of 10:15, 8 January 2014

Introduction

This How To makes a few assumptions:

  1. 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
  2. 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.
  3. 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 Orion client 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 orion, then select the client project.

The project page information for all of the Orion repositories can be found in the Gerrit project pages section below.

On the Orion client 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://git.eclipse.org:29418/orion/org.eclipse.orion.client. Copy this URL, we will use it in the next step.

Configure 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.

  1. Select the Orion client repository, taking you to the information page with a section called Remotes
  2. Expand that section and click the New Remote button on the right hand side
  3. In the Name box supply a meaningful name, such as gerrit
  4. In the URL box enter the URL fro the Gerrit project page, in this case it will be ssh://git.eclipse.org:29418/orion/org.eclipse.orion.client
    The new remote entry example for the Orion client
  5. Press Submit and you should see your new Gerrit remote
  6. In the Configuration section select the View all link on the right hand side
  7. Find the remote.gerrit.fetch setting and change it to be refs/notes/*:refs/notes/*
  8. Using the New Configuration Entry button on the right hand side and the new entry remote.gerrit.push and set its value to be HEAD:refs/for/master
    The new gerrit push configuration entry
  9. Head back to the Remotes section and do a pull on the gerrit remote to make sure it is working.

Gerrit project pages

  1. Orion client project page
  2. Orion marketplace project page
  3. Orion server project page