Skip to content

Latest commit

 

History

History
104 lines (94 loc) · 3.51 KB

CONTRIBUTING.md

File metadata and controls

104 lines (94 loc) · 3.51 KB

Contributing

Are you wondering how you can get started? You can learn how from this free series How to Contribute to an Open Source Project on GitHub.

Prerequisites

  1. A GitHub project in which you have access
  2. A text editor or IDE (integrated development environment)
  3. Basic knowledge of the command line in a terminal session
  4. git
  5. SSH key

How to submit a Pull Request (aka PR)

  1. Click the Fork button in the top right to copy the repo to your own GitHub project.
  2. Open a terminal and clone your forked project locally:
$ git clone git@github.com:your-project-name/chromebrew.git && cd chromebrew
  1. Create a branch for your PR:
$ git checkout -b update-cool-package
  1. Add, edit or delete the file(s) you would like to change and save.
  2. Test your changes! See steps 7 through 11 in the How to test a pending PR from another contributor section below.
  3. Stage your changes:
$ git add -A
  1. Review your changes:
$ git diff --staged
  1. Correct your changes and repeat steps 4 through 7, if necessary.
  2. Commit your changes:
$ git commit -m "Add some awesome change to cool package"
  1. Push your changes:
$ git push origin update-cool-package
  1. Visit your project page in the browser: https://github.com/your-project-name/chromebrew
  2. Click the New pull request button next to the Branch: selector drop-down.
  3. Select your branch name from the compare: selector drop-down on the right.
  4. Scroll down and review your changes.
  5. Click the Create pull request button.
  6. Add a short description of your change.
  7. Click the Create pull request button.

How to test a pending PR from another contributor

  1. Open the PR of interest.
  2. Next to the green Open badge, you should see something similar to:
contributor-name wants to merge 1 commit into chromebrew:master from contributor-name:update-cool-package
  1. On the far right, take note of contributor-name:update-cool-package. This is the PR contributor along with the branch they want to merge.
  2. Open a terminal, change to your cloned chromebrew directory and execute:
$ git remote add contributor-name git@github.com:contributor-name/chromebrew.git
  1. Fetch their branches:
$ git fetch contributor-name
  1. Checkout their branch:
$ git checkout update-cool-package
  1. If the requested change is a package:
$ cp packages/cool_package.rb /usr/local/lib/crew/packages/
  1. Test the new or updated package:
$ crew upgrade cool_package
  1. Examine the files to see if everything installed as expected:
$ crew files cool_package
  1. Run some tests on executables, if applicable:
$ cool_package --version
$ cool_package --help
$ cool_package --some-other-option
  1. To see if this package is a dependency for another package, execute:
$ grep "depends_on 'cool_package'" packages/*.rb

and, just in case:

$ grep 'depends_on "cool_package"' packages/*.rb

If the package is a dependency for another package, test commands of the other package, if possible, to see if they were affected in any way.

  1. Visit the PR and add a comment suggesting any changes or mark it RTBC if everything looks good.

Learn more