Developers/Getting Started/Working with GIT

Tine 2.0 uses GIT to manage its source code. This page shows the basic commands and workflow to get started in developing for Tine 2.0. NOTE This is not an GIT introduction. Please familiarize yourself with GIT using the documentation found in the net

Contents

Repositories

Tine 2.0 official upstream repository is located at

http://git.tine20.org/git/tine20

Development Cycle

Get a Working Copy

To checkout a working copy of our codebase just execute following commands on your development system:

cd /webserver/documentroot
git clone http://git.tine20.org/git/tine20
git checkout master

To update your working copy simply type

git pull

Start Developing

Developing bug fixes or changes is always done in separate branches. Each issue should be managed in a separate branch. Start your work with

git checkout -b mylovelyfeature

Now do your work commit your changes in reasonable steps

git add newfile
git add changedfile
git commit -m 'my changes'

Often the upstream evolves during you do your developments. Rebase your changes on top of the current upstream.

git checkout master
git pull
git checkout mylovelyfeature
git rebase master

Push your Changes

Once you are registered as a Tine 2.0 developer, you can push your changes into our code review system. If your changes get accepted they become part of the official Tine 2.0 upstream codebase.

NOTE: in gerrit you need to set your username and password for the GIT repository in your preferences yourself!

The review repository is physically a different from the upstream. You need to include it as a remote once

git remote add https://gerrit.tine20.org/tine20/p/tine20.git review

Before you push clean up you local history. Each commit you made opens a separate change request. Squash commits if reasonable. Also make sure your changes are rebased on the current upstream master. Push your changes with

git push review HEAD:refs/for/master

Review Process

You can find your change request in the gerrit web frontend

https://gerrit.tine20.org/tine20/#/q/is:starred,n,z

Your changes are automatically verified in our build system. Once your changes are verified, one ore more of the core developers will review your code manually and give feedback. If your changes are acceptable they get integrated into our upstream repository. Otherwise you will be asked to rework your changes and resubmit them.

Switch to your feature branch and rework changes as requested

git checkout mylovelyfeature

To resubmit your changes its IMPORTANT to AMEND your previous commit with the new one, and INCLUDE CHANGE-ID in your commit message. The change-id can be found when you open your change in the gerrit web frontend.

git commit --amend 

make sure to include the change-id at the end of your commit message.

Push your revised changes:

git push HEAD:refs/for/master

Tips and Tricks

Library Includes

Update Library

To update e.g. the Syncope library, just pull using the subtree merge strategy

git pull -s subtree http://git.tine20.org/git/Syncope <refspec>

This will introduce the commit from the library with a new merge commit

Include Library

git checkout master
git pull
mkdir tine20/library/Syncope
git fetch http://git.tine20.org/git/Syncope refs/heads/master
git read-tree --prefix=tine20/library/Syncope -u FETCH_HEAD
git commit -m 'Import of Syncope Library'
git merge --no-ff -s subtree FETCH_HEAD