Skip to content

Workflow

Piotr Stankowski edited this page May 15, 2016 · 7 revisions

Setting up the environment (Forking).

The best way to work on the CFAN project is to fork the project and clone it from your own github account. Then you can just clone the files onto your local machine:

> git clone git@github.com:github-user-name/CFAN

It's recommended you add the main CFAN repo as a remote upstream (using HTTPS to prevent accidental pushes):

> git remote add upstream https://github.com/trakos/CFAN.git

Keeping up to date (Pulling)

To keep your forked sub-projects up to date is pretty straight forward from here on out. Run the following after switching to your master branch:

> git fetch upstream
> git merge upstream/master
> git push origin master

This will pull the changes from upstream (the CFAN repositories), merge them into your master branch, and push the changes to your github fork.

Working on the code (Branches).

Try to create a branch for each feature/issue you work on. This allows for separate pull requests for each feature/issue.

> git checkout -b 999_fix_thing
Switched to a new branch '999_fix_thing'

> git commit thing.pl -m "I'm fixing a thing - closes #999"
[999_fix_thing 1dacc06] I'm fixing a thing - closes #999
 1 file changed, 1 insertion(+)
 create mode 100644 thing.pl

> git push origin 999_fix_thing 
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 305 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
To git@github.com:github-user-name/CFAN.git
   baad2a2..1dacc06  999_fix_thing -> 999_fix_thing

Pull requests

When making a pull request, please:

  • Make sure the pull request title is human friendly without following any links. "CFAN no longer runs slowly on Sundays (#1337)" is better than just "Fixes #1337".
  • Make sure you link any relevant issues in the body. For issues in the CFAN repo, you can just use #1337 syntax. For issues in other repos, it's KSP-CKAN/CKAN-meta#1337.
  • We love you most when your pull request comes with documentation and tests. We love you most of all when your pull request is documentation and tests on existing code.

When merging a pull request, make sure:

  • A human has tested the changes by building and running the client.
  • A human has reviewed the code.
  • They can be different humans. Hence if you've done one, but not the other, please comment this in the pull request body.

Compiling

Linux, command-line

Type make. You'll get a cfan.exe, cfan_headless.exe, cfan_updater.exe and cfan_netfan.exe in the top level folder.

Type make test to make with tests.