Development: Difference between revisions

From wiki.openchemistry.org
Jump to navigation Jump to search
(Initial version of the open chemistry development instructions page)
 
(Updated URL)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
The Open Chemistry projects use [http://git-scm.com/ git] for version control, and [http://code.google.com/p/gerrit/ Gerrit] for code review. The source code is mirrored on our [http://source.openchemistry.org/ infrastructure], [http://github.com/OpenChemistry Github] and [http://gitorious.org/openchemistry Gitorious]. These are read only mirrors, only the Gerrit hosted copy of the repository can be edited. Once topic braches are merged in using the Gerrit interface they are automatically replicated to these three locations.
The Open Chemistry projects use [http://git-scm.com/ git] for version control, and [https://github.com GitHub] for code review.
 
Refer to the [[build]] page for details of setting up and building the Open Chemistry project.


=Getting Started=
=Getting Started=


First you should go to [http://review.source.kitware.com/ http://review.source.kitware.com/] and log in using a valid OpenID.
First you should go to [https://github.com/openchemistry GitHub] and set up an account, and fork the repository you would like to contribute to.


* Go to Settings and configure your username (under profile)
* Set up your profile
* Upload your public SSH key (under SSH public keys)
* Upload your public SSH key (under SSH public keys)
* Ensure your name and email address are correct (under contact information)
* Ensure your name and email address are correct (under contact information)
Line 13: Line 15:
=Cloning Repositories=
=Cloning Repositories=


You should clone the repositories from our source code hosting infrastructure, or the Github/Gitorious mirror. You should also track changes from here as the cloning/update process will be faster, and is always in sync with Gerrit. To clone OpenQube for example,
You should clone the repositories from Github. To clone the Open Chemistry repository that contains the other projects as submodules,


   git clone git://source.openchemistry.org/openqube.git
   git clone --recursive git://github.com/openchemistry/openchemistry.git


=Setting up for Development=
=Updating=


Now you have successfully cloned the source code there is a little set up required. We have prepared a shell script which takes care of most of these details for you, which can be run interactively (or inspected and copy/pasted as required). In order to set up your new clone, change in to the directory and run the set up script.
In order to update the repository from the openchemistry module you can run,


   ./scripts/setup-for-development.sh
   git pull
  git submodule update --init


You will be prompted for details as required, defaults are shown in brackets. Pay close attention to the Gerrit username and authentication test if online (to verify SSH authentication works as expected). This will set up a gerrit remote, local git hooks (including one to automatically generate Change-Id lines) and ensure your name/email address is correct. It will also add a new git alias to push changes to Gerrit for review.
If you wish to checkout the master branch of a particular submodule and get the latest updates,
 
  cd avogadrolibs
  git checkout master
  git pull
 
This is preferred before starting any development topics.


=Uploading Proposed Changes=
=Uploading Proposed Changes=
Line 31: Line 40:
   git checkout -b topic-name
   git checkout -b topic-name


Once you are ready to commit, use the commit command as normal. When you would like to have your proposed changes reviewed use the git alias to push the changes.
Once you are ready to commit, use the commit command as normal. When you would like to have your proposed changes reviewed upload the topic to your fork on GitHub, and make a pull request. You should ping some reviewers in the comments, or post to the development list.
 
  git gerrit-push
 
The changes will appear on Gerrit, appropriate reviewers should be added. Once the topic is ready it will be merged using Gerrit, and replicated automatically.

Latest revision as of 19:58, 25 March 2015

The Open Chemistry projects use git for version control, and GitHub for code review.

Refer to the build page for details of setting up and building the Open Chemistry project.

Getting Started

First you should go to GitHub and set up an account, and fork the repository you would like to contribute to.

  • Set up your profile
  • Upload your public SSH key (under SSH public keys)
  • Ensure your name and email address are correct (under contact information)

These details will be used later.

Cloning Repositories

You should clone the repositories from Github. To clone the Open Chemistry repository that contains the other projects as submodules,

 git clone --recursive git://github.com/openchemistry/openchemistry.git

Updating

In order to update the repository from the openchemistry module you can run,

 git pull
 git submodule update --init

If you wish to checkout the master branch of a particular submodule and get the latest updates,

 cd avogadrolibs
 git checkout master
 git pull

This is preferred before starting any development topics.

Uploading Proposed Changes

You should develop all code on topic branches, branched from master.

 git checkout -b topic-name

Once you are ready to commit, use the commit command as normal. When you would like to have your proposed changes reviewed upload the topic to your fork on GitHub, and make a pull request. You should ping some reviewers in the comments, or post to the development list.