How to access the HALE sources

This article is outdated. Access the HALE sources on GitHub

Gerrit (outdated)

The HALE sources are available in a Git repository managed by a Gerrit installation on
http://git.esdi-community.eu

To browse the repository online use the Repository view on the project homepage.

Currently there are two main branches in the repository:
  • master - main branch with current developments
  • maintenance-2.1 - branch for maintenance of the 2.1.2 release

For working with the repository you will need an installation of Git. We recommend at least version 1.7.2. The examples on this page assume you have a git command line client on your path.
On Windows msysgit can serve for this purpose, the Git bash it provides can be used to execute the commands given below. On linux systems Git should be available in the respective package managers.

Anonymous access

As an anonymous user you have read access to all sources. You can also view changes in Gerrit but don't have the rights to vote on them.

Cloning the HALE repository with anonymous HTTP access to a folder hale:

git clone http://git.esdi-community.eu/p/hale hale

After cloning the repository, initialize and update the submodules (inside the repository folder):

git submodule init
git submodule update

Creating a user account in Gerrit

To be able to contribute and/or review changes you need an account in Gerrit. The HALE Gerrit uses OAuth authentication, currently supporting Google and Github accounts.

For the account creation visit http://git.esdi-community.eu and choose Register in the top right corner.
You can also access Gerrit through https if you prefer that, though currently there is only a self-signed certificate available.
You can currently log in with either a Google or Github account.
After the login you will be prompted to specify a user name for the use with Gerrit. In the following sections this user name will be referred to by $USERNAME.

Access the sources through SSH

Gerrit provides its own SSH server with a limited set of commands. Authentication is done through a public/private key pair.

Set up SSH authentication

First you need to generate a SSH key pair (if not already present)

mkdir -p ~/.ssh
ssh-keygen -b 4096 -t rsa -f ~/.ssh/id_rsa

When you log in with your Gerrit account you can register the public key with your account if you choose Settings->SSH Public Keys->Add Key...
There you can paste and save your public key. You can obtain your public key using this command:

cat ~/.ssh/id_rsa.pub

Finally you should save the user name that is used when connecting to the server where the repository is hosted:

echo -e "Host git.esdi-community.eu\n\tUser $USERNAME" >> ~/.ssh/config

Clone the repository over SSH

Cloning the repository to a folder hale:

git clone ssh://git.esdi-community.eu:29418/hale.git hale

Note that the host for the SSH access differs from the host that offers access to the Gerrit web interface.

Change into the repository folder, e.g. with

cd hale

If you want to work with the maintenance-2.1 branch, check it out now:

git checkout maintenance-2.1

Otherwise, you will be working with the master branch, which is checked out by default.

Now initialize and update the submodules:

git submodule init
git submodule update

Set up the repository for use with Gerrit

Pushing changes to Gerrit needs a ChangeId being present in the commit message. Gerrit offers a hook script that automates this task, you can install it by changing into the directory of your cloned repository, e.g. hale, and executing the following command:

scp -p -P 29418 git.esdi-community.eu:hooks/commit-msg .git/hooks/

Also, Gerrit will not allow you to push directly to the remote branch. Instead you have to push to a special ref named refs/for/$BRANCHNAME, $BRANCHNAME being replaced by the name of the branch.
For example, to push your current changes for the master branch you can use the following command:

git push origin HEAD:refs/for/master

To automatically push to this ref you can configure the repository in the following way:

git config remote.origin.push HEAD:refs/for/master

Also, you should do the Basic Git repository configuration.

Access the sources through HTTP/S

As a fallback if the access through SSH is not possible (e.g. if the port 29418 can't be accessed because of a firewall) there is the option to access the repository through HTTP/S, including the possibility to push changes. Please use this option only if SSH access is not possible for you.

For the non-anonymous HTTP/S access you need to log in to Gerrit and generate a HTTP password (Settings->HTTP Password->Generate Password).

Clone the repository over HTTPS

Temporarily disable SSL certificate certification (because currently only a self-signed certificate is used)

export GIT_SSL_NO_VERIFY=true

Cloning the repository to a folder hale (make sure to replace the user name):

git clone https://$USERNAME@git.esdi-community.eu/p/hale hale

After cloning the repository you should configure it to not verify SSL certificates, to prevent errors when further working with the repository. To do that change into the directory of the cloned repository, e.g. hale, and execute the following command:

git config --local http.sslverify false

This disables SSL certificate verification only for this repository.

After cloning the repository, initialize and update the submodules (inside the repository folder):

git submodule init
git submodule update

Set up the repository for use with Gerrit

Pushing changes to Gerrit needs a ChangeId being present in the commit message. Gerrit offers a hook script that automates this task, which usually can be retrieved through SSH. As SSH is not available in this case the script is also attached to this page. Place it in the .git/hooks/ folder inside your cloned repository.

Also, Gerrit will not allow you to push directly to the remote branch. Instead you have to push to a special ref named refs/for/$BRANCHNAME, $BRANCHNAME being replaced by the name of the branch.
For example, to push your current changes for the master branch you can use the following command:

git push origin HEAD:refs/for/master

To automatically push to this ref you can configure the repository in the following way:

git config remote.origin.push HEAD:refs/for/master

Also, you should do the Basic Git repository configuration.

commit-msg - Gerrit Hook Script to create ChangeId (2.2.1) (2.3 kB) Simon Templer, 09/07/2011 02:53 pm