From 4276c213f2256b7402f8c209b340602cea07c13f Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Wed, 19 Apr 2017 09:12:08 -0400 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/12510 Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum Reviewed-By: Rich Trott Reviewed-By: Gibson Fahnestock --- COLLABORATOR_GUIDE.md | 12 ++++++++++++ doc/onboarding-extras.md | 10 ---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index c7939e6eacc840..16d8e205ff50ef 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -372,6 +372,18 @@ Apply external patches $ curl -L https://github.com/nodejs/node/pull/xxx.patch | git am --whitespace=fix ``` +If the merge fails even though recent CI runs were successful, then a 3-way merge may +be required. In this case try: + +```text +$ git am --abort +$ curl -L https://github.com/nodejs/node/pull/xxx.patch | git am -3 --whitespace=fix +``` +If the 3-way merge succeeds you can proceed, but make sure to check the changes +against the original PR carefully and build/test on at least one platform +before landing. If the 3-way merge fails, then it is most likely that a conflicting +PR has landed since the CI run and you will have to ask the author to rebase. + Check and re-review the changes ```text diff --git a/doc/onboarding-extras.md b/doc/onboarding-extras.md index 5880536d04d634..a9f4885501e537 100644 --- a/doc/onboarding-extras.md +++ b/doc/onboarding-extras.md @@ -103,16 +103,6 @@ to update from nodejs/node: * `git merge --ff-only upstream/master` (or `REMOTENAME/BRANCH`) -## If `git am` fails - -* if `git am` fails – use `git am --abort` - * this usually means the PR needs updated - * prefer to make the originating user update the code, since they have it fresh in mind -* first, reattempt with `git am -3` (3-way merge)` -* if `-3` still fails, and you need to get it merged: - * `git fetch upstream pull/N/head:pr-N && git checkout pr-N && git rebase master` - - ## best practices * commit often, out to your github fork (origin), open a PR