1# How to Contribute 2 3We'd love to accept your patches and contributions to this project. There are 4just a few small guidelines you need to follow. 5 6## Contributor License Agreement 7 8Contributions to this project must be accompanied by a Contributor License 9Agreement. You (or your employer) retain the copyright to your contribution; 10this simply gives us permission to use and redistribute your contributions as 11part of the project. Head over to <https://cla.developers.google.com/> to see 12your current agreements on file or to sign a new one. 13 14You generally only need to submit a CLA once, so if you've already submitted one 15(even if it was for a different project), you probably don't need to do it 16again. 17 18## Code reviews 19 20All submissions, including submissions by project members, require review. We 21use a [Gerrit](https://www.gerritcodereview.com) instance hosted at 22https://chromium-review.googlesource.com for this purpose. 23 24## Sending patches 25 26The basic git workflow for modifying libwebp code and sending for review is: 27 281. Get the latest version of the repository locally: 29 30 ```sh 31 git clone https://chromium.googlesource.com/webm/libwebp && cd libwebp 32 ``` 33 342. Copy the commit-msg script into ./git/hooks (this will add an ID to all of 35 your commits): 36 37 ```sh 38 curl -Lo .git/hooks/commit-msg https://chromium-review.googlesource.com/tools/hooks/commit-msg && chmod u+x .git/hooks/commit-msg 39 ``` 40 413. Modify the local copy of libwebp. Make sure the code 42 [builds successfully](https://chromium.googlesource.com/webm/libwebp/+/HEAD/doc/building.md#cmake). 43 444. Choose a short and representative commit message: 45 46 ```sh 47 git commit -a -m "Set commit message here" 48 ``` 49 505. Send the patch for review: 51 52 ```sh 53 git push https://chromium-review.googlesource.com/webm/libwebp HEAD:refs/for/main 54 ``` 55 56 Go to https://chromium-review.googlesource.com to view your patch and 57 request a review from the maintainers. 58 59See the 60[WebM Project page](https://www.webmproject.org/code/contribute/submitting-patches/) 61for additional details. 62 63## Code Style 64 65The C code style is based on the 66[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) and 67`clang-format --style=Google`, though this project doesn't use the tool to 68enforce the formatting. 69 70CMake files are formatted with 71[cmake-format](https://cmake-format.readthedocs.io/en/latest/). `cmake-format 72-i` can be used to format individual files, it will use the settings from 73`.cmake-format.py`. 74 75## Community Guidelines 76 77This project follows 78[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). 79