From dfb1b853602fa105d212dd61f03074ba69e684e1 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Wed, 19 Apr 2017 09:12:08 -0400 Subject: [PATCH 1/3] 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. --- COLLABORATOR_GUIDE.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index c7939e6eacc840..ead4d8ecd4ac1d 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -372,6 +372,16 @@ 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 +$ curl -L https://github.com/nodejs/node/pull/xxx.patch | git am --3way --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. + Check and re-review the changes ```text From a486f09522fca7ccb272f59449332629d5d10468 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Wed, 19 Apr 2017 19:04:02 -0400 Subject: [PATCH 2/3] squash: address first set of comments --- COLLABORATOR_GUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index ead4d8ecd4ac1d..708b0908917b32 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -376,7 +376,7 @@ If the merge fails even though recent CI runs were successful, then a 3-way merg be required. In this case try: ```text -$ curl -L https://github.com/nodejs/node/pull/xxx.patch | git am --3way --whitespace=fix +$ 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 From 5e78104926b88c44194aad20c4cf0ebc4445646a Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Thu, 20 Apr 2017 09:12:56 -0400 Subject: [PATCH 3/3] squash: address next set of comments --- COLLABORATOR_GUIDE.md | 4 +++- doc/onboarding-extras.md | 10 ---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 708b0908917b32..16d8e205ff50ef 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -376,11 +376,13 @@ If the merge fails even though recent CI runs were successful, then a 3-way merg 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. +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 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