Contributing
Contents |
Overview
This page describes the patch submission process. As an open source project, oVirt gladly accepts and encourages the submission of patches from the community.
Prerequisites
To clone a copy of one of the project repositories, please see the build instructions web page.
Basically, what you need to have is a development environment that allows you to create a branch for writing your code and to build and test your changes prior to submitting them to the project.
Creating The Development Branch
Unless you're submitting a high priority bug fix, all patches should be based on the current development branch.
First, Start Tracking The Next Branch (Only Do It Once)
The oVirt team does all development work on a branch named next, so you should create your development branch off of that. To begin tracking the next branch, in your git repo you would do the following:
git checkout -b next --track origin/next
which creates a local branch named next which will track the remote branch with the name next; i.e., it will update based on the central repository's contents.
Second, Create Your Development Branch
Now that you have the next branch, you will create your development branch based on it. To do so, you do the following:
git checkout -b [the name of your branch] next
This creates a new branch with the name you specified and bases it on the next branch. You want to do this to ensure that your changes will cleanly apply on top of the current codebase.
Now you're ready to start working on your new feature or bug fix.
Testing
In order to verify that the bug is fixed, you will need to thorough test your changes prior to submitting them to the project for consideration. Depending on the code being written, the type of tests will change.
Committing Your Changes
You should frequent check in your changes to make sure your work isn't lost.
When you get to a stopping point, you can commit your changes to Git using the following:
git commit -a [--amend]
You only need to include the --amend argument on subsequent commits to add them to your previous changes. Be sure you do not do this with your first commit as that will tack it onto someone else's work.
Commit Comments
When entering the comment for your patch, please use the first line to be a one sentence summary of your changes, and try to limit it to less than 70 characters. This line is used by Git to set the Subject: of the patch email that you will create later.
Starting with the second line, please provide a sufficiently details description of what the patch is providing. If there is a bugzilla ticket that is related to the patch, please include a line such as this at the end of the comment:
Resolves: rhbz#123456
where the numbers are the Bugzilla ticket id.
ChangeLog Entry
Please be sure to add a note in the file ChangeLog describing your patch. This helps to make sure your changes are documented when a release is made available.
Creating And Submitting The Patch
To create a patch in Git, you will do the following.
git format-patch HEAD~1 --signoff
This creates a new, ready-to-be-mailed patch file that will include all of your changes, as well as your details. This is important: we want to make sure you get the credit for your changes, and also keep track of who made what changes so that questions go to the right person.
Once created, simple send the patch using the following:
git send-email [the name of the patch file]

