Skip to content

Development on PerfCake

Martin Večeřa edited this page Jun 14, 2013 · 13 revisions

This is a guide to help you start developing on PerfCake.

Git flow

For Git we use git-flow. Please note that our development branch is called just 'devel' and not 'develop' as in the default Git Flow environment.

You can get it from here.

Here you can find a useful tutorial video about how to use it.

Setting up your workspace

Create a github account

http://github.com

Fork PerfCake into your account

http://github.com/PerfCake/PerfCake

Clone your newly forked copy onto your local workspace

$ git clone git@github.com:[your user]/PerfCake.git
Cloning into 'PerfCake'...
remote: Counting objects: 368, done.
remote: Compressing objects: 100% (209/209), done.
remote: Total 368 (delta 135), reused 365 (delta 132)
Receiving objects: 100% (368/368), 1.18 MiB | 294.00 KiB/s, done.
Resolving deltas: 100% (135/135), done.

Add a remote ref to upstream, for pulling future updates

$ cd PerfCake
$ git remote add upstream git://github.com/PerfCake/PerfCake.git

To see your remotes:

$ git remote -v
origin      git@github.com:[your user]/PerfCake.git (fetch)
origin      git@github.com:[your user]/PerfCake.git (push)
upstream    git://github.com/PerfCake/PerfCake.git (fetch)
upstream    git://github.com/PerfCake/PerfCake.git (push)

Checkout the devel branch

$ git checkout devel

Initialize git flow extension in your repo

$ git flow init
Which branch should be used for bringing forth production releases?
   - devel
   - master
Branch name for production releases: [master] 
Which branch should be used for integration of the "next release"?
   - devel
Branch name for "next release" development: [develop] devel
How to name your supporting branch prefixes?
Feature branches? [feature/] 
Release branches? [release/] 
Hotfix branches? [hotfix/] 
Support branches? [support/] 
Version tag prefix? [] 

Use maven (PerfCake is currently using maven 3.0.x)

$ mvn clean install

NOTE: if the build fails, try $ mvn -U clean install. This will pull down changes in parent that might be causing the build failure.

Pulling later updates from upstream

$ git pull --rebase upstream devel
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
From github.com:PerfCake/PerfCake
* branch            devel     -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Fast-forwarded master to fd771bb54bdbab544f0e21f4c3700d58c7c2e626.

Voluntarily you can setup an alias: $ git config --global alias.up "pull --rebase"

And then just use the new alias instead of pull: $ git up upstream devel

Pushing pulled updates to your private github repo (origin)

$ git push origin devel
Counting objects: 192, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (44/44), done.
Writing objects: 100% (100/100), 10.67 KiB, done.
Total 100 (delta 47), reused 100 (delta 47)
To git@github.com:[your user]/PerfCake.git
   3382570..1fa25df  devel -> devel

You might need to say -f to force the changes.

Contributing a change

Discuss your planned changes

Make sure there is an issue on GitHub for the enhancement/fix

https://github.com/PerfCake/PerfCake/issues

Initialize a feature branch

Do not forget to include the issue number in the feature branch name (e.g. contribution-how-to-#9).

$ git flow feature start "contribution-how-to-#9"
Switched to a new branch 'feature/contribution-how-to-#9'
Summary of actions:
- A new branch 'feature/contribution-how-to-#9' was created, based on 'devel'
- You are now on branch 'feature/contribution-how-to-#9'
Now, start committing on your feature. When done, use:
     git flow feature finish contribution-how-to-#9

Publish the feature branch to you forked repo

$ git flow feature publish 'contribution-how-to-#9'
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 320 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To git@github.com:marvec/PerfCake.git
 * [new branch]      feature/contribution-how-to-#9 -> feature/contribution-how-to-#9
Already on 'feature/contribution-how-to-#9'

Summary of actions:
- A new remote branch 'feature/contribution-how-to-#9' was created
- The local branch 'feature/contribution-how-to-#9' was configured to track the remote branch
- You are now on branch 'feature/contribution-how-to-#9'

Request a pull request

On github start a pull request of your feature branch to PerfCake's devel branch. After accepting the pull request, you can either merge it into devel and remove like this:

$ git flow feature finish 'contribution-how-to-#9'
Switched to branch 'devel'
Updating f75f35d..76b90c0
Fast-forward
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Deleted branch feature/contribution-how-to-#9 (was 76b90c0).

Summary of actions:
- The feature branch 'feature/contribution-how-to-#9' was merged into 'devel'
- Feature branch 'feature/contribution-how-to-#9' has been removed
- You are now on branch 'devel'

Or you can just delete the branch and pull changes in devel from the upstream.

Processing a pull request

TBD