Difference between revisions of "Contributing code"

From Omni
Jump to: navigation, search
(Steps to Contribute Code to Omnirom)
(Steps to Contribute Code to Omnirom)
Line 1: Line 1:
  
== Steps to Contribute Code to Omnirom ==
+
== Beginning Steps to Contribute Code to Omnirom ==
  
 
The beauty of open source projects is the ability for even the most novice of developers to be involved in determining the trajectory of the project. The difficulty is in knowing exactly how to submit your patch for code review and (hopefully) inclusion into the project.
 
The beauty of open source projects is the ability for even the most novice of developers to be involved in determining the trajectory of the project. The difficulty is in knowing exactly how to submit your patch for code review and (hopefully) inclusion into the project.

Revision as of 22:30, 1 November 2013

Beginning Steps to Contribute Code to Omnirom

The beauty of open source projects is the ability for even the most novice of developers to be involved in determining the trajectory of the project. The difficulty is in knowing exactly how to submit your patch for code review and (hopefully) inclusion into the project.

Below are the simple, basic steps for contributing code:

  1. Begin by performing a repo sync so that we know we’re dealing with the most recent versions of the code. We're also assuming that you have your Omnirom repo in ~/android/omni:
    cd ~/android/omni
    repo sync
  2. Now go and make the changes to the files you are wanting to patch/include.
  3. Once done, navigate to the root of the project, i.e. the root of your local repo
    cd ~/android/omni
  4. Begin a new branch of the local repo so that you can track your changes
    SYNTAX: repo start <branchName> <directoryOfPackageChanged>
    EXAMPLE: repo start bootAnimation vendor/omni
    Note: it is important to use relative path names to where you are in your repo.
  5. Now navigate to the package directory (<directoryOfPackageChanged> above)
  6. We need to commit the changes to gerrit for review, along with a message telling exactly what was done for the reviewer(s) to review
    • First we make sure to add the files that we changed in order to be committed:
    git add . (this will add all of the files which are new based on the <directoryOfPackageChanged>)
    • Now we need to commit the changes:
    git commit -a
    • This will open up an editor and at the top line you will need to provide the comment about the changes you have done.
    Suggested format: <PackageName>: <overview of change(s) made>
    Example: Bootanimation: Updated the bootanimation for the project
    • Once done press CTRL-O to save your changes, and then CTRL-X to exit
    Your changes will be saved, and you’ll receive a notice about the number of changes to be submitted
  7. Now we need to upload our changes to gerrit for review.
    repo upload
    This will upload the changes, and you’ll receive a web link to those changes, i.e. https://gerrit.omnirom.org/1479/

Licensing

It is important that any code you contribute follows either the existing licensing, or utilizes the correct licensing. For pre-created headers, see the License template