Skip to content

Commit 18d73a3

Browse files
authored
CONTRIBUTING.md: Update commit guidelines
It came up in #11073, and I saw it could use a little updating. Notably, I'm linking to a guide to what Git commit messages should look like. I also tried to make the language less heavy-handed and demanding.
1 parent 70ae832 commit 18d73a3

File tree

1 file changed

+25
-32
lines changed

1 file changed

+25
-32
lines changed

CONTRIBUTING.md

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,43 +30,36 @@ style configurations are commonly useful. For IntelliJ 14, copy the style to
3030
`~/.IdeaIC14/config/codestyles/`, start IntelliJ, go to File > Settings > Code
3131
Style, and set the Scheme to `GoogleStyle`.
3232

33-
## Maintaining clean commit history
34-
35-
We have few conventions for keeping history clean and making code reviews easier
36-
for reviewers:
37-
38-
* First line of commit messages should be in format of
39-
40-
`package-name: summary of change`
41-
42-
where the summary finishes the sentence: `This commit improves gRPC to ____________.`
43-
44-
for example:
45-
46-
`core,netty,interop-testing: add capacitive duractance to turbo encabulators`
47-
48-
* Every time you receive a feedback on your pull request, push changes that
49-
address it as a separate one or multiple commits with a descriptive commit
50-
message (try avoid using vauge `addressed pr feedback` type of messages).
51-
52-
Project maintainers are obligated to squash those commits into one when
53-
merging.
54-
5533
## Guidelines for Pull Requests
5634
How to get your contributions merged smoothly and quickly.
5735

5836
- Create **small PRs** that are narrowly focused on **addressing a single concern**. We often times receive PRs that are trying to fix several things at a time, but only one fix is considered acceptable, nothing gets merged and both author's & review's time is wasted. Create more PRs to address different concerns and everyone will be happy.
5937

60-
- For speculative changes, consider opening an issue and discussing it first. If you are suggesting a behavioral or API change, consider starting with a [gRFC proposal](https://github.com/grpc/proposal).
61-
62-
- Provide a good **PR description** as a record of **what** change is being made and **why** it was made. Link to a github issue if it exists.
63-
64-
- Don't fix code style and formatting unless you are already changing that line to address an issue. PRs with irrelevant changes won't be merged. If you do want to fix formatting or style, do that in a separate PR.
65-
66-
- Unless your PR is trivial, you should expect there will be reviewer comments that you'll need to address before merging. We expect you to be reasonably responsive to those comments, otherwise the PR will be closed after 2-3 weeks of inactivity.
67-
68-
- Maintain **clean commit history** and use **meaningful commit messages**. See [maintaining clean commit history](#maintaining-clean-commit-history) for details.
69-
38+
- For speculative changes, consider opening an issue and discussing it to avoid
39+
wasting time on an inappropriate approach. If you are suggesting a behavioral
40+
or API change, consider starting with a [gRFC
41+
proposal](https://github.com/grpc/proposal).
42+
43+
- Follow [typical Git commit message](https://cbea.ms/git-commit/#seven-rules)
44+
structure. Have a good **commit description** as a record of **what** and
45+
**why** the change is being made. Link to a GitHub issue if it exists. The
46+
commit description makes a good PR description and is auto-copied by GitHub if
47+
you have a single commit when creating the PR.
48+
49+
If your change is mostly for a single module (e.g., other module changes are
50+
trivial), prefix your commit summary with the module name changed. Instead of
51+
"Add HTTP/2 faster-than-light support to gRPC Netty" it is more terse as
52+
"netty: Add faster-than-light support".
53+
54+
- Don't fix code style and formatting unless you are already changing that line
55+
to address an issue. If you do want to fix formatting or style, do that in a
56+
separate PR.
57+
58+
- Unless your PR is trivial, you should expect there will be reviewer comments
59+
that you'll need to address before merging. Address comments with additional
60+
commits so the reviewer can review just the changes; do not squash reviewed
61+
commits unless the reviewer agrees. PRs are squashed when merging.
62+
7063
- Keep your PR up to date with upstream/master (if there are merge conflicts, we can't really merge your change).
7164

7265
- **All tests need to be passing** before your change can be merged. We recommend you **run tests locally** before creating your PR to catch breakages early on. Also, `./gradlew build` (`gradlew build` on Windows) **must not introduce any new warnings**.

0 commit comments

Comments
 (0)