Drupal Dev Notes is a new series of screencasts that I'm starting to share all of the Drupal development know-how, habits and tricks that I wish I'd learned the easy way.
The first of these is how to contribute to projects on drupal.org. The best way to get started with contrib is by making small fixes to other people's projects. This way you can learn Drupal coding standards and best practices gradually, with help from other Drupal developers. It can also be really fun :)
UPDATE: I highly recommend reading How to Solve All Your Problems first, especially if you haven't been active on the issue queue before.
- Install Git
There's installation instructions for Git on drupal.org. If those don't work for you, try http://help.github.com/ and then follow Randy Fay's screencast to hook it up to Drupal (or read the instructions on drupal.org). - Choose issue
You can either look at issues on a specific project, or a great way to find easy ones is to look for the Novice tag. You want the issue status to be either 'active' or 'needs work'. - Download project
Each project has Git instructions. Choose the latest branch, which will probably be 7.x-?.x or master. Click 'Show' and copy the command. Then run the command in the sites/all/modules directory. - Find bug
egrep -r hook_node_info simpletest_example/ - Make branch
git checkout -b [short description]-[issue-number] - Fix code
Refer to coding standards for code style. - Create patch
git diff > [description]-[issue-number]-[comment-number].patch
Randy Fay has a great post about patching with Git. - Upload patch for review
People often use Dreditor to review patches. - Make revisions
Once you get feedback, you can make revisions to the patch.
Refresh your repo usinggit checkout [version]
git pull
Then re-apply changes:git apply -v [patchname].patch
Other Links
- Jacine gives an in depth guide to how patches work
- Advanced patch contributor guide
- Priority levels for an issue
- Randy Fay's blog
Comments
Thanks
Thanks for writing this up Lin. I've been wanting to help out more by contributing patches but didn't know where to start - I had no idea about the novice tag. This is a good first step.
thanks,pete
Glad to hear it!