Skip to content

Contribution Guide

Anas Nashif edited this page Apr 29, 2017 · 17 revisions

Introduction

Refer to documentation at Zephyr Project website for more information on how to configure, install and use Zephyr Project.

Repository layout

To clone the Zephyr Project repository:

git clone https://github.com/zephyrproject-rtos/zephyr

Pull Requests and Issues

You can find open Pull Requests on GitHub here and you can find open issues here.

Contributing

To contribute to Zephyr Project it is helpful to provide as much information as you can about your change, including any updates to documentation (if appropriate), and test... test... test.

  • Fork zephyr on github

  • Clone the fork you made to your computer

    git clone https://github.com/<your github id>/zephyr
    
  • Create a topic branch for your work

    git checkout -b fix_comment_typo
    
  • Make changes

  • hack

  • test

  • hack

  • etc...

  • Add your changes

    git add [file(s) that changed, add -p if you want to be more specific]
    
  • Verify you are happy with your changes to be committed

    git diff --cached
    
  • Commit changes

    git commit -s
    

The -s automatically adds your Signed-off-by: [name] <email> to your commit message. Your commit will be rejected without this.

Also, please explain what your change does. "Fix stuff" will be rejected. For examples of good commit messages, read the changelog.

  • Push your topic branch with your changes to your fork

    git push origin fix_comment_typo
    
  • Go to the zephyr project and click the Compare & pull request button for the branch you want to open a pull request with.

  • Review the pull request changes, and verify that you are opening a pull request for the appropriate branch. The title and message should reflect the nature/theme of the changes in the PR, say the title is Fix comment typos and the message details any specifics you can provide.

  • You might change the zephyr branch, if you are opening a pull request that is intended for a different branch. For example, when you created your topic branch you could have done:

    git checkout -b fix_out_of_date_patch origin/net
    

Then when you get to this pull request screen change the base branch from master to net

  • By creating a pull request, the PR is entered into the backlog. A CI job will run to test your changes against a select set of samples. As they start to get worked, they should be placed in the Ready state. PRs that are being worked are In Progress. If a questions come up about the commit that might involve changes to the commit then the PR is placed in Waiting For Response.

  • Interactively rebase the offending commit(s) to fix the code review:

    git fetch --all
    git rebase --ignore-whitespace origin master
    git rebase -i <offending-commit-id>^
    

    NOTE: The --ignore-whitespace stops git apply (which is called by rebase) from changing any whitespace when it runs.

    Replace pick with edit or remove the line to delete a commit. Fix the issue in the code review.

    git add [file(s)]
    git rebase --continue
    <update commit comment if needed>
    git push --force origin fix_comment_typo
    

Gerrit

We previously used gerrit for development, but it is no longer used. We'd like to see patches that are still applicable turned into Pull Requests on GitHub.

You can find the list of pending patches available on gerrit.

Clone this wiki locally