Skip to content

Commit b227574

Browse files
mhdawsonevanlucas
authored andcommitted
doc: add suggestion to use --3way
The CI seems to do a 3way merge so it is possible that even though the CI passed, the existing git am command may fail. Add text to suggest how to handle this by adding the --3way option. PR-URL: #12510 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 42a51b6 commit b227574

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

COLLABORATOR_GUIDE.md

+12
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,18 @@ Apply external patches
372372
$ curl -L https://github.com/nodejs/node/pull/xxx.patch | git am --whitespace=fix
373373
```
374374

375+
If the merge fails even though recent CI runs were successful, then a 3-way merge may
376+
be required. In this case try:
377+
378+
```text
379+
$ git am --abort
380+
$ curl -L https://github.com/nodejs/node/pull/xxx.patch | git am -3 --whitespace=fix
381+
```
382+
If the 3-way merge succeeds you can proceed, but make sure to check the changes
383+
against the original PR carefully and build/test on at least one platform
384+
before landing. If the 3-way merge fails, then it is most likely that a conflicting
385+
PR has landed since the CI run and you will have to ask the author to rebase.
386+
375387
Check and re-review the changes
376388

377389
```text

doc/onboarding-extras.md

-10
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,6 @@ to update from nodejs/node:
103103
* `git merge --ff-only upstream/master` (or `REMOTENAME/BRANCH`)
104104

105105

106-
## If `git am` fails
107-
108-
* if `git am` fails – use `git am --abort`
109-
* this usually means the PR needs updated
110-
* prefer to make the originating user update the code, since they have it fresh in mind
111-
* first, reattempt with `git am -3` (3-way merge)`
112-
* if `-3` still fails, and you need to get it merged:
113-
* `git fetch upstream pull/N/head:pr-N && git checkout pr-N && git rebase master`
114-
115-
116106
## best practices
117107

118108
* commit often, out to your github fork (origin), open a PR

0 commit comments

Comments
 (0)