Contributing to GTG

GTG uses Bazaar for versioning. It might be useful to read the tutorial first.

Dependencies

You need to have python-configobj installed

Getting the code

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

$ bzr branch lp:gtg trunk

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

Choosing a feature to work on

If you are a happy user of GTG and nothing bothers you but you would like to contribute you can :

Working on the 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 "description of my change"

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=python3
./run-tests
...........
----------------------------------------------------------------------
Ran 11 tests in 0.063s

OK

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

$ make lint=python3
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) If the trunk has been updated while you were hacking, you should update your local trunk branch, and merge modification in your branch.

$ cd ../trunk
$ bzr pull trunk
$ cd ../cool-new-feature
$ bzr merge ../trunk

If you have conflicts, you must solve them (see this or search google for information about conflict solving.

Once you don't have any conflict anymore, you must commit the changes related to the merge. Use a clear commit message, like "Updating branch by merging the last trunk version."

8) 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.

If your branch is solving specific reported bugs, please also register your branch to these bugs (there is an link for that in each bug report page). It allows to link together all related resources (which in turn is useful to dig out precious information from all the discussions that happened around those bugs).

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

Troubleshooting

If you have a problem with SSH keys while uploading to launchpad, look at this SuperUser question.

Apps/GTG/contributing (last edited 2015-01-06 10:33:39 by OliverPropst)