|
| 1 | +# How to contribute |
| 2 | + |
| 3 | +Tera is BSD 3-Clause licensed and accepts contributions via GitHub pull requests. |
| 4 | +This document outlines some of the conventions on commit message formatting, |
| 5 | +bug reporting and other resources to make getting your contribution |
| 6 | +into Tera easier. |
| 7 | + |
| 8 | +## Email and chat |
| 9 | + |
| 10 | +- Email: tera_dev at baidu.com |
| 11 | +- IRC: QQ group 340418305 |
| 12 | + |
| 13 | +## Getting started |
| 14 | + |
| 15 | +- __Star__ Tera project |
| 16 | +- __Fork__ the repository on GitHub |
| 17 | +- Read the __[BUILD](../BUILD)__ for build instructions |
| 18 | + |
| 19 | +## Reporting bugs and creating issues |
| 20 | + |
| 21 | +Reporting bugs is one of the best ways to contribute. If any part of the Tera project |
| 22 | +has bugs or documentation mistakes, please let us know by __opening an issue__. We |
| 23 | +treat bugs and mistakes very seriously and believe no issue is too small. Before creating |
| 24 | +a bug report, please check that an issue reporting the same problem does not already exist. |
| 25 | + |
| 26 | +To make the bug report accurate and easy to understand, please try to write the bug reports that are: |
| 27 | + |
| 28 | +- Specific. Include as much details as possible: which version, what environment, |
| 29 | + what configuration, etc. If the bug is related to running the Tera service, |
| 30 | + please attach the Tera log and runtime stack. |
| 31 | + |
| 32 | +- Reproducible. Include the steps to reproduce the problem. |
| 33 | + |
| 34 | +- Unique. Please do not duplicate existing bug report. |
| 35 | + |
| 36 | +- Scoped. One bug per report. Do not follow up with another bug inside one report. |
| 37 | + |
| 38 | +## Contribution flow |
| 39 | + |
| 40 | +This is a rough outline of what a contributor's workflow looks like: |
| 41 | + |
| 42 | +- Create a topic branch from where you want to base your work. This is usually master. |
| 43 | +- Make commits of logical units and __must__ add test case for bug fixing or add new functionality. |
| 44 | +- Make sure your commit messages are in the proper format (see below). |
| 45 | +- Push your changes to a topic branch in your fork of the repository. |
| 46 | +- Submit a pull request to baidu/tera. |
| 47 | +- Your PR must receive a LGTM from __two__ committers. |
| 48 | + |
| 49 | +Thanks for your contributions! |
| 50 | + |
| 51 | +### Code style |
| 52 | + |
| 53 | +Tera follows Google's C++ coding style except for 4 spaces of default indentation. See the [style doc](https://google.github.io/styleguide/cppguide.html) for details. |
| 54 | + |
| 55 | +Please follow this style to make Tera easy to review, maintain and develop. |
| 56 | + |
| 57 | +### Commit message format |
| 58 | + |
| 59 | +We follow a rough convention for commit messages that is designed to answer two |
| 60 | +questions: what changed and why. The subject line should feature the what and |
| 61 | +the body of the commit should describe the why. |
| 62 | + |
| 63 | +``` |
| 64 | +issue=#1000: support leveldb's log for switching and evicting |
| 65 | +
|
| 66 | +tera use leveldb's PosixLogger to dump log info; it can not support switch log by size and automatic elimination, |
| 67 | +which will cause leveldb.log growing too large. |
| 68 | +
|
| 69 | +``` |
| 70 | + |
| 71 | +The format can be described more formally as follows: |
| 72 | + |
| 73 | +``` |
| 74 | +issue=#xxxx: <what changed> |
| 75 | +<BLANK LINE> |
| 76 | +<why this change was made> |
| 77 | +<BLANK LINE> |
| 78 | +``` |
| 79 | + |
| 80 | +The first line is the subject and should be no longer than 70 characters, the |
| 81 | +second line is always blank, and other lines should be wrapped at 80 characters. |
| 82 | +This makes the message to be easier to read on GitHub as well as in various |
| 83 | +git tools. |
0 commit comments