Skip to content

Commit c7e103e

Browse files
author
Michael Gasch
committed
docs: Clarify squash in CONTRIBUTING
Closes: #2736 Signed-off-by: Michael Gasch <[email protected]>
1 parent bcc324b commit c7e103e

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,30 +109,34 @@ $ git push --force-with-lease $USER issue-<number>
109109

110110
### Updating Pull Requests
111111

112-
If your PR fails to pass CI or needs changes based on code review, you'll most
113-
likely want to squash these changes into existing commits.
112+
If your PR fails to pass CI or needs changes based on code review, it's ok to
113+
add more commits stating the changes made, e.g. "Address review comments". This
114+
is to assist the reviewer(s) to easily detect and review the recent changes.
114115

115-
If your pull request contains a single commit or your changes are related to the
116-
most recent commit, you can simply amend the commit.
116+
In case of small PRs, it's ok to squash and force-push (see further below)
117+
directly instead.
117118

118119
```console
120+
# incorporate review feedback
119121
$ git add .
120-
$ git commit --amend
121-
$ git push --force-with-lease $USER issue-<number>
122+
123+
# create a fixup commit which will be merged into your (original) <commit>
124+
$ git commit --fixup <commit>
125+
$ git push $USER issue-<number>
122126
```
123127

124-
If you need to squash changes into an earlier commit, you can use:
128+
Be sure to add a comment to the PR indicating your new changes are ready to
129+
review, as Github does not generate a notification when you git push.
130+
131+
Once the review is complete, squash and push your final commit(s):
125132

126133
```console
127-
$ git add .
128-
$ git commit --fixup <commit>
134+
# squash all commits into one
135+
# --autosquash will automatically detect and merge fixup commits
129136
$ git rebase -i --autosquash vmware/master
130137
$ git push --force-with-lease $USER issue-<number>
131138
```
132139

133-
Be sure to add a comment to the PR indicating your new changes are ready to
134-
review, as Github does not generate a notification when you git push.
135-
136140
### Code Style
137141

138142
The coding style suggested by the Go community is used in `govmomi`. See the

0 commit comments

Comments
 (0)