Skip to content

Contributing Code to ArrayFire

pradeep edited this page Jul 15, 2021 · 1 revision

Using GitHub

This method will require you to sign up on github. If you want to contribute without signing up on github, please check the Using Email section.

For this entire section, we are going to assume your github id is MYNAME. Please replace it with your actual id where appropriate.

  1. Fork ArrayFire

    You can follow these instructions to fork ArrayFire. If this succeeds, you should now have a version of ArrayFire at https://github.com/MYNAME/arrayfire

  2. Clone your fork

    You can now clone your fork using the following command.

    git clone https://github.com/MYNAME/arrayfire
    

    When you clone the repository, the current branch should be master. You can verify this by running the following command.

    $ git branch
    * master
    
  3. Setting upstream and creating new branch

    It is advisable that the master branch tracks upstream. You can do this by using the following commands.

    git remote add upstream https://github.com/arrayfire/arrayfire
    git branch -u upstream/master
    

    You can now create a new branch using the following commands.

    git checkout -b BRANCH_NAME 
    
  4. Make changes and commits

    You can now make changes to ArrayFire. While adding code, try to

    • Follow Google's C++ Style guide.
    • Keep the commits self contained. Do not add independent features in the same commit.
    • Keep the commit messages concise. You can add details after leaving an empty line after the commit message.
    • Ensure all the tests are passing.
    • If you are adding a new file, please add a LICENSE notice at the top of your file.
  5. Push to your fork

    After you are done committing, you can push to your fork using the following.

    git push -u origin 
    
  6. Submit pull request

    You can now send a pull request for your code to be merged upstream. The instructions for doing this can be found here.

    All pull requests go into master branch.

    • If your pull request does not change any API, then it will be later picked into corresponding v<Major>-<Minor> branch and will be made available in the next fix release for that feature release(v<Major>-<Minor>).
    • If your pull request adds new functions/features, or adds default arguments to existing functions, without breaking the current API, then it will be made available in the next feature release.
    • If your pull request breaks API or removes support for certain features, then send it to the master branch. However, mark it as a deliverable for the next major release milestone (currently 4.0). This will not be merged until the 4.0 branch is created.
  7. Update master

    After your branch has been merged, you can update your master branch using the following

    git checkout master
    git pull
    

Using Email

You can send the git diff patches to our mailing list.

Please specify your first and last name so we can attribute the commit to the right person.