Skip to content

Creating and submitting an acceptable patch

pascalrobert edited this page Dec 3, 2012 · 1 revision

Objective

How a non-committer should submit a patch to Project Wonder source that is easy and convenient for committers to apply.

Prerequisites

  • You have Wonder source checked out onto your system and imported into Eclipse workspace as per instructions
  • You have fully tested your changes

Webcast

We have done a webcast about how to contribute to Project Wonder by using Git, you can get the recording here.

Procedure

Now that Project Wonder is hosted on GitHub, you can provide a patch in two different ways: by creating your own fork on Wonder, fix the code and create a Pull Request, or by doing the classical way of providing a patch file.

The Pull Request Way

This is way to go! Using pull requests on GitHub make it a lot easier to give feedback on contributions, and are more easier to track.

How can you create a pull request? Pull request is GitHub lingo for merging chances from two forks on the same code base. Basically, the steps are:

  • If you don't already have one, you need to create a GitHub account
  • You go on the Project Wonder page on GitHub and you click on the Fork button. This action will create a fork (copy) of the Wonder code in your account.
  • Clone your fork on your computer. That will give you the chance to do contributions to Wonder in your own copy of the work.
  • Do commits on your computer.
  • When you are ready to make your work available, push your commits from your computer to your fork on GitHub.
  • Create a pull request so your contributions can be added to the main fork of Wonder.

It might be a lot of steps, but really, you will find after a couple of days that it's a really good workflow!

GitHub have to fantastic help pages about how to fork a repository and how to create pull requests, it's a must read.

The Patch File Way

You can create a patch file in Eclipse by doing a right-click on the project you modified, select Team->Show History, and in the history, select Create Patch. You will need to upload your issue somewhere since you can't attach files to issues on GitHub, and create an issue on GitHub with a link to your patch file. But really, please use pull requests instead of patch files, thank you.