Skip to content

Commit e3a8207

Browse files
committed
Merge #8034: [doc][trivial] Add basic git squash workflow [skip ci]
90963e5 [doc] Add basic git squash example (fanquake)
2 parents eb2f6f7 + 90963e5 commit e3a8207

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ To contribute a patch, the workflow is as follows:
1717
- Create topic branch
1818
- Commit patches
1919

20-
The project coding conventions in [doc/developer-notes.md](doc/developer-notes.md) must be adhered to.
20+
The project coding conventions in the [developer notes](doc/developer-notes.md) must be adhered to.
2121

2222
In general [commits should be atomic](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention) and diffs should be easy to read. For this reason do not mix any formatting fixes or code moves with actual code changes.
2323

2424
Commit messages should be verbose by default consisting of a short subject line (50 chars max), a blank line and detailed explanatory text as separate paragraph(s); unless the title alone is self-explanatory (like "Corrected typo in main.cpp") then a single title line is sufficient. Commit messages should be helpful to people reading your code in the future, so explain the reasoning for your decisions. Further explanation [here](http://chris.beams.io/posts/git-commit/).
2525

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

2828
Please refer to the [Git manual](https://git-scm.com/doc) for more information about Git.
2929

@@ -35,13 +35,27 @@ The title of the pull request should be prefixed by the component or area that t
3535
Consensus: Add new opcode for BIP-XXXX OP_CHECKAWESOMESIG
3636
Net: Automatically create hidden service, listen on Tor
3737
Qt: Add feed bump button
38-
Trivial: fix typo
38+
Trivial: Fix typo in main.cpp
3939

40-
If a pull request is specifically not to be considered for merging (yet) please prefix the title with [WIP] or use [Tasks Lists](https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments) in the body of the pull request to indicate tasks are pending.
40+
If a pull request is specifically not to be considered for merging (yet) please prefix the title with [WIP] or use [Tasks Lists](https://help.github.com/articles/basic-writing-and-formatting-syntax/#task-lists) in the body of the pull request to indicate tasks are pending.
4141

4242
The body of the pull request should contain enough description about what the patch does together with any justification/reasoning. You should include references to any discussions (for example other tickets or mailing list discussions).
4343

44-
At this stage one should expect comments and review from other contributors. You can add more commits to your pull request by committing them locally and pushing to your fork until you have satisfied all feedback. If your pull request is accepted for merging, you may be asked by a maintainer to squash and or rebase your commits before it will be merged. The length of time required for peer review is unpredictable and will vary from patch to patch.
44+
At this stage one should expect comments and review from other contributors. You can add more commits to your pull request by committing them locally and pushing to your fork until you have satisfied all feedback.
45+
46+
Squashing Commits
47+
---------------------------
48+
If your pull request is accepted for merging, you may be asked by a maintainer to squash and or [rebase](https://git-scm.com/docs/git-rebase) your commits before it will be merged. The basic squashing workflow is shown below.
49+
50+
git checkout your_branch_name
51+
git rebase -i HEAD~n
52+
# n is normally the number of commits in the pull
53+
# set commits from 'pick' to 'squash', save and quit
54+
# on the next screen, edit/refine commit messages
55+
# save and quit
56+
git push -f # (force push to GitHub)
57+
58+
The length of time required for peer review is unpredictable and will vary from pull request to pull request.
4559

4660

4761
Pull Request Philosophy
@@ -61,15 +75,15 @@ Refactoring is a necessary part of any software project's evolution. The followi
6175

6276
There are three categories of refactoring, code only moves, code style fixes, code refactoring. In general refactoring pull requests should not mix these three kinds of activity in order to make refactoring pull requests easy to review and uncontroversial. In all cases, refactoring PRs must not change the behaviour of code within the pull request (bugs must be preserved as is).
6377

64-
Project maintainers aim for a quick turnaround on refactoring pull requests, so where possible keep them short, uncomplex and easy to verify.
78+
Project maintainers aim for a quick turnaround on refactoring pull requests, so where possible keep them short, uncomplex and easy to verify.
6579

6680

6781
"Decision Making" Process
6882
-------------------------
6983

7084
The following applies to code changes to the Bitcoin Core project (and related projects such as libsecp256k1), and is not to be confused with overall Bitcoin Network Protocol consensus changes.
7185

72-
Whether a pull request is merged into Bitcoin Core rests with the project merge maintainers and ultimately the project lead.
86+
Whether a pull request is merged into Bitcoin Core rests with the project merge maintainers and ultimately the project lead.
7387

7488
Maintainers will take into consideration if a patch is in line with the general principles of the project; meets the minimum standards for inclusion; and will judge the general consensus of contributors.
7589

0 commit comments

Comments
 (0)