@@ -365,60 +365,45 @@ The TSC should serve as the final arbiter where required.
365
365
* If more than one author has contributed to the PR, keep the most recent
366
366
author when squashing.
367
367
368
- Always modify the original commit message to include additional meta
369
- information regarding the change process:
370
-
371
- - A ` PR-URL: ` line that references the * full* GitHub URL of the original
372
- pull request being merged so it's easy to trace a commit back to the
373
- conversation that led up to that change.
374
- - A ` Fixes: X ` line, where _ X_ either includes the * full* GitHub URL
375
- for an issue, and/or the hash and commit message if the commit fixes
376
- a bug in a previous commit. Multiple ` Fixes: ` lines may be added if
377
- appropriate.
378
- - A ` Refs: ` line referencing a URL for any relevant background.
379
- - A ` Reviewed-By: Name <email> ` line for yourself and any
380
- other Collaborators who have reviewed the change.
381
- - Useful for @mentions / contact list if something goes wrong in the PR.
382
- - Protects against the assumption that GitHub will be around forever.
383
-
384
368
Review the commit message to ensure that it adheres to the guidelines outlined
385
369
in the [ contributing] ( ./CONTRIBUTING.md#commit-message-guidelines ) guide.
386
370
371
+ Add all necessary [ metadata] ( #metadata ) to commit messages before landing.
372
+
387
373
See the commit log for examples such as
388
374
[ this one] ( https://github.com/nodejs/node/commit/b636ba8186 ) if unsure
389
375
exactly how to format your commit messages.
390
376
391
377
Additionally:
392
378
- Double check PRs to make sure the person's _ full name_ and email
393
379
address are correct before merging.
394
- - Except when updating dependencies, all commits should be self
395
- contained (meaning every commit should pass all tests). This makes
396
- it much easier when bisecting to find a breaking change.
380
+ - All commits should be self-contained (meaning every commit should pass all
381
+ tests). This makes it much easier when bisecting to find a breaking change.
397
382
398
383
### Technical HOWTO
399
384
400
- Clear any ` am ` /` rebase ` that may already be underway.
385
+ Clear any ` am ` /` rebase ` that may already be underway:
401
386
402
387
``` text
403
388
$ git am --abort
404
389
$ git rebase --abort
405
390
```
406
391
407
- Checkout proper target branch
392
+ Checkout proper target branch:
408
393
409
394
``` text
410
395
$ git checkout master
411
396
```
412
397
413
398
Update the tree (assumes your repo is set up as detailed in
414
- [ CONTRIBUTING.md] ( CONTRIBUTING.md#step-1-fork ) )
399
+ [ CONTRIBUTING.md] ( CONTRIBUTING.md#step-1-fork ) ):
415
400
416
401
``` text
417
402
$ git fetch upstream
418
403
$ git merge --ff-only upstream/master
419
404
```
420
405
421
- Apply external patches
406
+ Apply external patches:
422
407
423
408
``` text
424
409
$ curl -L https://github.com/nodejs/node/pull/xxx.patch | git am --whitespace=fix
@@ -436,21 +421,19 @@ against the original PR carefully and build/test on at least one platform
436
421
before landing. If the 3-way merge fails, then it is most likely that a conflicting
437
422
PR has landed since the CI run and you will have to ask the author to rebase.
438
423
439
- Check and re-review the changes
424
+ Check and re-review the changes:
440
425
441
426
``` text
442
427
$ git diff upstream/master
443
428
```
444
429
445
- Check number of commits and commit messages
430
+ Check number of commits and commit messages:
446
431
447
432
``` text
448
433
$ git log upstream/master...master
449
434
```
450
435
451
- If there are multiple commits that relate to the same feature or
452
- one with a feature and separate with a test for that feature,
453
- you'll need to use ` squash ` or ` fixup ` :
436
+ Squash commits and add metadata:
454
437
455
438
``` text
456
439
$ git rebase -i upstream/master
@@ -506,9 +489,29 @@ Save the file and close the editor. You'll be asked to enter a new
506
489
commit message for that commit. This is a good moment to fix incorrect
507
490
commit logs, ensure that they are properly formatted, and add
508
491
` Reviewed-By ` lines.
492
+
509
493
* The commit message text must conform to the
510
494
[ commit message guidelines] ( ./CONTRIBUTING.md#commit-message-guidelines ) .
511
495
496
+ <a name =" metadata " ></a >
497
+ * Modify the original commit message to include additional metadata regarding
498
+ the change process. (If you use Chrome or Edge, [ ` node-review ` ] [ ] fetches
499
+ the metadata for you.)
500
+
501
+ * Required: A ` PR-URL: ` line that references the * full* GitHub URL of the
502
+ original pull request being merged so it's easy to trace a commit back to
503
+ the conversation that led up to that change.
504
+ * Optional: A ` Fixes: X ` line, where _ X_ either includes the * full* GitHub URL
505
+ for an issue, and/or the hash and commit message if the commit fixes
506
+ a bug in a previous commit. Multiple ` Fixes: ` lines may be added if
507
+ appropriate.
508
+ * Optional: One or more ` Refs: ` lines referencing a URL for any relevant
509
+ background.
510
+ * Required: A ` Reviewed-By: Name <email> ` line for yourself and any
511
+ other Collaborators who have reviewed the change.
512
+ * Useful for @mentions / contact list if something goes wrong in the PR.
513
+ * Protects against the assumption that GitHub will be around forever.
514
+
512
515
Run tests (` make -j4 test ` or ` vcbuild test ` ). Even though there was a
513
516
successful continuous integration run, other changes may have landed on master
514
517
since then, so running the tests one last time locally is a good practice.
@@ -672,3 +675,4 @@ LTS working group and the Release team.
672
675
[ Stability Index ] : doc/api/documentation.md#stability-index
673
676
[ Enhancement Proposal ] : https://github.com/nodejs/node-eps
674
677
[ git-username ] : https://help.github.com/articles/setting-your-username-in-git/
678
+ [ `node-review` ] : https://github.com/evanlucas/node-review
0 commit comments