Contributing to GTG

Getting the code

1) Get the latest version of the code on Launchpad:

$ bzr branch lp:gtg

Although if you're thinking of contributing more than one patch, you might want to do:

$ bzr init-repo gtg
$ cd gtg
$ bzr branch lp:gtg trunk

This will share revision data between branches, reducing storage costs & network time.

2) Launch gtg :

$ cd trunk
$ ./gtg

2b) Launch gtg with debugging data (so it doesn't mess with your data) :

$ cd trunk
$ ./scripts/debug.sh

Working on a feature in a branch

1) You have your local copy of the code (see "Getting the code"). Now, create a local branch of your local branch (yes, it is)

$ cd ..
$ bzr branch trunk cool-new-feature

(your trunk folder is branched in a new cool-new-feature folder)

When working with Bazaar, it's a good idea to keep your local trunk branch as a pristine copy of trunk on Launchpad.

2) Hack hack hack

3)

bzr commit -m "my local commit"

4) Do 2) and 3) as much as you want. Don't hesitate to abuse the local commits. Think of 'commit' like 'quick save' in a video game :)

5)

a) Run the units tests to see if all is fine.

$ make check
./run-tests
...........
----------------------------------------------------------------------
Ran 11 tests in 0.063s

OK

b) Run the lint checker to make sure the code is clean

$ make lint
pyflakes GTG
find . -name '*.py' -print0 | xargs -0 ./scripts/pep8.py
./setup.py:22:56: W291 trailing whitespace
[... stuff ...]
find . -name '*.py' -print0 | xargs -0 ./scripts/pep8.py --repeat | wc -l
2590

Please leave the number at the bottom smaller than when you found it.

6) Modify CHANGELOG to reflect your changes. If it's your first contribution, add yourself in the AUTHORS file with your email address.

7) Pushing your work to your own branch on Launchpad (where "ploum" is your Launchpad username):

$ bzr push lp:~ploum/gtg/cool-new-feature

Alternatively, if you want other gtg users to be able to write to your branch, push it in the gtg-user group (you have to be part of it)

$ bzr push lp:~gtg-user/gtg/ploum_branch

9) Ask for a merge request and comment on the corresponding bug. (Open one if there is none). Add the tag "toreview" to the bug in Launchpad. This is very important and ensures we are not letting a patch rotting.

You can file a bug at https://bugs.launchpad.net/gtg/+filebug.

To ask for a merge request, run

$ cd cool-new-feature
$ bzr lp-open

This will open the branch's web page on Launchpad. From there, click 'Propose for merging'.

Alternatively, you can use bzr send to submit your changes. See the Launchpad documentation and the Bazaar user guide for more information.

For more detailed information, see the HACKING guide included in the GTG code.

gtg/contributing (last edited 2009-07-30 19:17:55 by LionelDricot)