Skip to content

Commit 4fa4cc4

Browse files
committed
Update Contributing guidelines
Mainly punctuation and styling changes. Added a section about rebasing pull requests.
1 parent a544132 commit 4fa4cc4

File tree

1 file changed

+73
-24
lines changed

1 file changed

+73
-24
lines changed

CONTRIBUTING.md

Lines changed: 73 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ facilitates social contribution, easy testing and peer review.
2424

2525
To contribute a patch, the workflow is as follows:
2626

27-
- Fork repository
28-
- Create topic branch
29-
- Commit patches
27+
1. Fork repository
28+
2. Create topic branch
29+
3. Commit patches
3030

3131
The project coding conventions in the [developer notes](doc/developer-notes.md)
3232
must be adhered to.
@@ -40,12 +40,14 @@ Commit messages should be verbose by default consisting of a short subject line
4040
paragraph(s), unless the title alone is self-explanatory (like "Corrected typo
4141
in init.cpp") in which case a single title line is sufficient. Commit messages should be
4242
helpful to people reading your code in the future, so explain the reasoning for
43-
your decisions. Further explanation [here](http://chris.beams.io/posts/git-commit/).
43+
your decisions. Further explanation [here](https://chris.beams.io/posts/git-commit/).
4444

45-
If a particular commit references another issue, please add the reference, for
46-
example `refs #1234`, or `fixes #4321`. Using the `fixes` or `closes` keywords
45+
If a particular commit references another issue, please add the reference. For
46+
example: `refs #1234` or `fixes #4321`. Using the `fixes` or `closes` keywords
4747
will cause the corresponding issue to be closed when the pull request is merged.
4848

49+
Commit messages should never contain any `@` mentions.
50+
4951
Please refer to the [Git manual](https://git-scm.com/doc) for more information
5052
about Git.
5153

@@ -81,7 +83,11 @@ Examples:
8183
Qt: Add feed bump button
8284
Trivial: Fix typo in init.cpp
8385

84-
If a pull request is specifically not to be considered for merging (yet) please
86+
Note that translations should not be submitted as pull requests, please see
87+
[Translation Process](https://github.com/pivx-project/pivx/blob/master/doc/translation_process.md)
88+
for more information on helping with translations.
89+
90+
If a pull request is not to be considered for merging (yet), please
8591
prefix the title with [WIP] or use [Tasks Lists](https://help.github.com/articles/basic-writing-and-formatting-syntax/#task-lists)
8692
in the body of the pull request to indicate tasks are pending.
8793

@@ -94,6 +100,8 @@ At this stage one should expect comments and review from other contributors. You
94100
can add more commits to your pull request by committing them locally and pushing
95101
to your fork until you have satisfied all feedback.
96102

103+
Note: Code review is a burdensome but important part of the development process, and as such, certain types of pull requests are rejected. In general, if the **improvements** do not warrant the **review effort** required, the PR has a high chance of being rejected. It is up to the PR author to convince the reviewers that the changes warrant the review effort, and if reviewers are "Concept NAK'ing" the PR, the author may need to present arguments and/or do research backing their suggested changes.
104+
97105
Squashing Commits
98106
---------------------------
99107
If your pull request is accepted for merging, you may be asked by a maintainer
@@ -102,12 +110,16 @@ before it will be merged. The basic squashing workflow is shown below.
102110

103111
git checkout your_branch_name
104112
git rebase -i HEAD~n
105-
# n is normally the number of commits in the pull
106-
# set commits from 'pick' to 'squash', save and quit
107-
# on the next screen, edit/refine commit messages
108-
# save and quit
113+
# n is normally the number of commits in the pull request.
114+
# Set commits (except the one in the first line) from 'pick' to 'squash', save and quit.
115+
# On the next screen, edit/refine commit messages.
116+
# Save and quit.
109117
git push -f # (force push to GitHub)
110118

119+
Please update the resulting commit message if needed, it should read as a
120+
coherent message. In most cases this means that you should not just list the
121+
interim commits.
122+
111123
If you have problems with squashing (or other workflows with `git`), you can
112124
alternatively enable "Allow edits from maintainers" in the right GitHub
113125
sidebar and ask for help in the pull request.
@@ -120,11 +132,37 @@ the respective change set.
120132
The length of time required for peer review is unpredictable and will vary from
121133
pull request to pull request.
122134

135+
Rebasing Pull Requests
136+
-------------------------
137+
It may become necessary for a pull request to be rebased after other pull requests have been
138+
merged. This is typically due to mutually exclusive changes (conflicts) between your pull
139+
request and the current `master` branch.
140+
141+
When a rebase is needed, a comment will be added to the pull request indicating this need.
142+
Rather than simply merge the `master` branch into your pull request (which results in an
143+
ugly and confusing merge commit), it is better to use git's rebase feature. The basic
144+
workflow is as follows:
145+
146+
# replace 'origin' with the remote name for the main project repo in the example
147+
git checkout your_branch_name
148+
git fetch origin
149+
git pull --rebase origin master
150+
151+
This will "rewind" your branch commits, pull any new commits from `master`, then attempt to
152+
re-apply your commits on top of the new HEAD. If any conflicts are found, the process will
153+
pause and allow you to resolve any conflicts. Once conflicts have been resolved:
154+
155+
git rebase --continue
156+
157+
Repeat as necessary until there are no more conflicts and your git tree is in a clean state.
158+
The final step is to push your rebased branch back up to github:
159+
160+
git push -f # force pushes the branch to github
123161

124162
Pull Request Philosophy
125163
-----------------------
126164

127-
Patch sets should always be focused. For example, a pull request could add a
165+
Patchsets should always be focused. For example, a pull request could add a
128166
feature, fix a bug, or refactor code; but not a mixture. Please also avoid super
129167
pull requests which attempt to do too much, are overly large, or overly complex
130168
as this makes review difficult.
@@ -148,10 +186,18 @@ There are three categories of refactoring, code only moves, code style fixes,
148186
code refactoring. In general refactoring pull requests should not mix these
149187
three kinds of activity in order to make refactoring pull requests easy to
150188
review and uncontroversial. In all cases, refactoring PRs must not change the
151-
behavior of code within the pull request (bugs must be preserved as is).
189+
behaviour of code within the pull request (bugs must be preserved as is).
152190

153191
Project maintainers aim for a quick turnaround on refactoring pull requests, so
154-
where possible keep them short, un-complex and easy to verify.
192+
where possible keep them short, uncomplex and easy to verify.
193+
194+
Pull requests that refactor the code should not be made by new contributors. It
195+
requires a certain level of experience to know where the code belongs and to
196+
understand the full ramification (including rebase effort of open pull requests).
197+
198+
Trivial pull requests or pull requests that refactor the code with no clear
199+
benefits may be immediately closed by the maintainers to reduce unnecessary
200+
workload on reviewing.
155201

156202

157203
"Decision Making" Process
@@ -169,9 +215,9 @@ judge the general consensus of contributors.
169215

170216
In general, all pull requests must:
171217

172-
- have a clear use case, fix a demonstrable bug or serve the greater good of
218+
- Have a clear use case, fix a demonstrable bug or serve the greater good of
173219
the project (for example refactoring for modularisation);
174-
- be well peer reviewed;
220+
- Be well peer reviewed;
175221
- follow code style guidelines;
176222

177223
Patches that change PIVX consensus rules are considerably more involved than
@@ -185,13 +231,16 @@ patches because of increased peer review and consensus building requirements.
185231

186232
Anyone may participate in peer review which is expressed by comments in the pull
187233
request. Typically reviewers will review the code for obvious errors, as well as
188-
test out the patch set and opine on the technical merits of the patch. Project
234+
test out the patchset and opine on the technical merits of the patch. Project
189235
maintainers take into account the peer review when determining if there is
190236
consensus to merge a pull request (remember that discussions may have been
191-
spread out over GitHub, forums, email, and Slack discussions). The following
237+
spread out over GitHub, forums, email, and Discord discussions). The following
192238
language is used within pull-request comments:
193239

194-
- ACK means "I have tested the code and I agree it should be merged";
240+
- (t)ACK means "I have tested the code and I agree it should be merged", involving
241+
change-specific manual testing in addition to running the unit and functional
242+
tests, and in case it is not obvious how the manual testing was done, it should
243+
be described;
195244
- NACK means "I disagree this should be merged", and must be accompanied by
196245
sound technical justification (or in certain cases of copyright/patent/licensing
197246
issues, legal justification). NACKs without accompanying reasoning may be
@@ -209,13 +258,13 @@ that have demonstrated a deeper commitment and understanding towards the project
209258
(over time) or have clear domain expertise may naturally have more weight, as
210259
one would expect in all walks of life.
211260

212-
Where a patch set affects consensus critical code, the bar will be set much
261+
Where a patchset affects consensus critical code, the bar will be set much
213262
higher in terms of discussion and peer review requirements, keeping in mind that
214263
mistakes could be very costly to the wider community. This includes refactoring
215264
of consensus critical code.
216265

217-
Where a patch set proposes to change the PIVX consensus, it must have been
218-
discussed extensively on the forums and Slack, be accompanied by a widely
266+
Where a patchset proposes to change the PIVX consensus, it must have been
267+
discussed extensively on the forums and Discord, be accompanied by a widely
219268
discussed Proposal and have a generally widely perceived technical consensus of being
220269
a worthwhile change based on the judgement of the maintainers.
221270

@@ -237,15 +286,15 @@ about:
237286
that personally, though! Instead, take another critical look at what you are suggesting
238287
and see if it: changes too much, is too broad, doesn't adhere to the
239288
[developer notes](doc/developer-notes.md), is dangerous or insecure, is messily written, etc.
240-
Identify and address any of the issues you find. Then ask e.g. on Slack if someone could give
289+
Identify and address any of the issues you find. Then ask e.g. on Discord if someone could give
241290
their opinion on the concept itself.
242291
- It may be because your code is too complex for all but a few people. And those people
243292
may not have realized your pull request even exists. A great way to find people who
244293
are qualified and care about the code you are touching is the
245294
[Git Blame feature](https://help.github.com/articles/tracing-changes-in-a-file/). Simply
246295
find the person touching the code you are touching before you and see if you can find
247296
them and give them a nudge. Don't be incessant about the nudging though.
248-
- Finally, if all else fails, ask on Slack or elsewhere for someone to give your pull request
297+
- Finally, if all else fails, ask on Discord or elsewhere for someone to give your pull request
249298
a look. If you think you've been waiting an unreasonably long amount of time (month+) for
250299
no particular reason (few lines changed, etc), this is totally fine. Try to return the favor
251300
when someone else is asking for feedback on their code, and universe balances out.

0 commit comments

Comments
 (0)