Contributing a new feature or fix
Overview
Contributing a new feature or bug fix is a bit more involved than just building JOGL. The main difference is that instead of pulling the code from the canonical repository on GitHub, you need to fork it, then work on your own repository. When you're done, you submit a "pull request" on GitHub for the lead developer to review your changes.
You should already have built JOGL at least once before this, so you're sure Git and all the other tools are set up and working correctly.
Create a free GitHub account
Go to http://github.com/ and create a free GitHub account. We use GitHub's infrastructure to share code between developers and manage pull requests.
Generate new (or use existing) SSH keys
You'll use these keys to access your GitHub code repositories.
- To generate keys, see http://help.github.com/msysgit-key-setup/.
- If you already have RSA keys in an .ssh directory, you can just enter one of them into GitHub.
- To test, type "ssh [email protected]" and enter your passphrase at the prompt. It should say "You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed."
Set your username and email in Git global settings
This is needed so your changes to the code will be attributed to you correctly.
- Open a shell
- Type this: git config --global user.name "Your Name"
- Type this: git config --global user.email "[email protected]"
You can check the current values of these settings by typing "git config --global user.name" and "git config --global user.email".
Fork the gluegen and jogl projects on GitHub
This creates your initial copies of the code repositories, and gives you a place to push your change branches to.
- See http://help.github.com/forking/ for instructions
- Log into GitHub
- Go to https://github.com/sgothel/gluegen, press the "Fork" button
- Go to https://github.com/sgothel/jogl, press the "Fork" button
Clone gluegen and jogl locally from your forks
This creates your local working copy of the code.
- Open a new shell and cd to where you want your repositories
- Type these commands (they'll require your SSH passphrase)
- To get gluegen: git clone [email protected]:YourGitHubName/gluegen.git gluegen
- To get jogl: git clone [email protected]:YourGitHubName/jogl.git jogl
Build the projects
This works just like the build process discussed in "Building JOGL on the command line".
- cd to gluegen/make, type "ant clean", then type "ant"
- cd to jogl/make, type "ant clean", then type "ant"
Create a bug report at https://jogamp.org/bugzilla/
This gives you a bug number, which is good to name your code branches with.
NOTE: There's currently a bug the Bugzilla "Log In" link. You can click it and type your login and password, but it doesn't log you in.
So instead of clicking the "Log In" link, click the "New" link, and log in on the page that says "I need a legitimate login and password to continue". You'll need to type your full email address, then your password.
Create branch for fix
- cd jogl
- git branch bug_xxx
- git checkout bug_xxx
Change files, test, and commit
- git status (shows modified files)
- git commit -a -v (commits all modified files, lets you type commit message)
Push branch back to Github
- git push origin bug_xxx
Send pull request on Github
- Instructions on http://help.github.com/pull-requests/
- Go to your project on Github
- Switch branch to bug_xxx
- Press "Pull Request" button
- Type comment, check diffs
- Press "Send pull request"
Wait for your pull request to be accepted
This may take a while, depending on how busy the lead developer is. Also, the lead may ask you to change some aspects of your commits if they don't fit in with other code or don't work during regression testing.
When your pull request is accepted, update the bug status to "Resolved" on Bugzilla!