At Cappuccino we use github’s pull requests to integrate code from outside parties, so contributing code is fairly simple.
You'll want to start by forking the main Cappuccino branch and creating your own copy. To do this, just click the "fork" button at our main page. You only need to do this once, and you can clone your forked repository to your local machine by doing the following:
$ git clone email@example.com:yourusername/cappuccino.git
Note that this URL is what is listed as "Your Clone URL" and not "Public Clone URL".
This will clone your fork to your local machine, not the Cappuccino master. To create a link to the Cappuccino master in your local repository, do the following:
$ cd cappuccino $ git remote add upstream git://github.com/cappuccino/cappuccino.git $ git fetch upstream
When making changes, you always want to base your changes on the latest Cappuccino master, to reduce the changes to a minimum. This is accomplished by making a "topic" branch from upstream/master:
$ git fetch upstream $ git branch --track <topic> upstream/master $ git checkout <topic>
<topic> is the name of the topic branch, and usually is named to reflect the change being made. For example, if you are fixing
CPColor -colorWithHexString, you might name the branch "colorWithHexString-fix":
$ git branch --track colorWithHexString-fix upstream/master $ git checkout colorWithHexString-fix
You can now proceed to make all the appropriate changes on your own git repository.
IMPORTANT: You must follow the Cappuccino Coding Style Guidelines when submitting code for inclusion in Cappuccino. Please use the
capp_lint tool (in cappuccino/Tools/capp_lint) to check your code, or if you are using Sublime Text 2 as your editor, you can use the SublimeLinter plugin, which has capp_lint built in. We're sorry, but we cannot accept code that does not conform to our coding guidelines.
If your code makes any functional changes to a Foundation class, please add a suitable test in
cappuccino/Tests/Foundation. If your code makes any functional changes to an AppKit class, modify or add a suitable test in
cappuccino/Tests/AppKit. If your change does not unit test well you can modify one of the manual tests in
cappuccino/Tests/Manual or add a new test app if necessary.
After you have written and tested your code, commit your changes.
IMPORTANT: You must follow the commit message guidelines when writing commit messages for inclusion in the Cappuccino repository. This is critical, it helps us enormously.
Before pushing your topic branch to your github fork, first you have to make sure you won’t conflict with the latest Cappuccino master:
$ git pull
If you get merge conflicts when pulling, you will have to resolve them manually and then commit your changes.
Now you can push your topic branch to your github fork:
$ git push origin <topic>
Finally, you need to turn your topic branch into a pull request. Open your browser and go to
<username> is your github username and
<topic> is the name of the topic branch you just pushed.
If necessary, modify the pull request title and comments to be as descriptive as possible.
Click on the "Files Changed" tab and review the changes to make sure only the changes you intended to part of the pull request are included.
When you are sure everything looks good, click "Send pull request". We will review it as soon as we have time and make comments or ask questions via the pull request’s page on github.