Contributing a new feature or fix: Difference between revisions

From JogampWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
= Overview =
= 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.
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 forked repository. When you're done, you submit a "pull request" on GitHub for the maintainer 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.
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.
Line 7: Line 7:
= Create a free GitHub account =
= 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.
Go to http://github.com/ and create a free GitHub account. We use GitHub's infrastructure to share code between developers and to manage pull requests.


= Generate new (or use existing) SSH keys =
= Generate new (or use existing) SSH keys =
Line 34: Line 34:
* See http://help.github.com/forking/ for instructions
* See http://help.github.com/forking/ for instructions
* Log into GitHub
* Log into GitHub
* Go to https://github.com/sgothel/gluegen, press the "Fork" button
* Go to https://github.com/sgothel/gluegen, then press the "Fork" button
* Go to https://github.com/sgothel/jogl, press the "Fork" button
* Go to https://github.com/sgothel/jogl, then press the "Fork" button


= Clone gluegen and jogl locally from your forks =
 
Now when you go to http://github.com/, you'll see gluegen and jogl under "Your Repositories" on the right.
 
= Clone gluegen and jogl from your forks =


This creates your local working copy of the code.
This creates your local working copy of the code.


* Open a new shell and cd to where you want your repositories
* Open a new shell and cd to where you want your repositories.
* Type these commands (they'll require your SSH passphrase)
* Type these commands (they'll require your SSH passphrase).
** To get gluegen: git clone git@github.com:YourGitHubName/gluegen.git gluegen  
** To get gluegen: git clone git@github.com:YourGitHubName/gluegen.git gluegen  
** To get jogl: git clone git@github.com:YourGitHubName/jogl.git jogl  
** To get jogl: git clone git@github.com:YourGitHubName/jogl.git jogl  
Line 50: Line 53:
This works just like the build process discussed in [[Building JOGL on the command line|"Building JOGL on the command line"]].
This works just like the build process discussed in [[Building JOGL on the command line|"Building JOGL on the command line"]].


* cd to gluegen/make, type "ant clean", then type "ant"
* cd to gluegen/make, type "ant clean", then type "ant".
* cd to jogl/make, type "ant clean", then type "ant"
* cd to jogl/make, type "ant clean", then type "ant".
 
= Create an enhancement request or bug report =


= Create a bug report at https://jogamp.org/bugzilla/ =
Log into https://jogamp.org/bugzilla/ and create an enhancement request or bug report.


This gives you a bug number, which is good to name your code branches with.
This gives you a Bugzilla ticket number, which is good to name your code branches with. A new feature can be entered into Bugzilla as ticket with severity set to "enhancement" instead of "critical", "major", et cetera.


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.
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.
Line 61: Line 66:
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.
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 =
= Create a branch for your feature or fix =


* cd jogl  
* cd jogl  

Revision as of 00:08, 11 January 2011

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 forked repository. When you're done, you submit a "pull request" on GitHub for the maintainer 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 to 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 git@github.com" 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 "someone@wherever.com"


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.


Now when you go to http://github.com/, you'll see gluegen and jogl under "Your Repositories" on the right.

Clone gluegen and jogl 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 git@github.com:YourGitHubName/gluegen.git gluegen
    • To get jogl: git clone git@github.com: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 an enhancement request or bug report

Log into https://jogamp.org/bugzilla/ and create an enhancement request or bug report.

This gives you a Bugzilla ticket number, which is good to name your code branches with. A new feature can be entered into Bugzilla as ticket with severity set to "enhancement" instead of "critical", "major", et cetera.

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 a branch for your feature or 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!