@@ -377,8 +377,45 @@ Merging strategy:
377
377
* Default to βsquash and mergeβ
378
378
* Make sure the commit message captures the core ideas of the pull request.
379
379
* βRebase and mergeβ when moving files (do a ` git mv ` as a separate commit)
380
+ * βCreate a merge commitβ when porting changes across branches
380
381
* Refrain from force-pushing while the PR is under review (which includes rebasing and squashing)
381
382
383
+ Porting changes across branches:
384
+
385
+ * Pull requests should target the lowest possible
386
+ [ supported version] ( https://ignitionrobotics.org/docs/all/releases ) where the
387
+ changes can be added in a backwards-compatible way (no API / ABI / behavior
388
+ break in released branches).
389
+ * Periodically, a maintainer will ** forward-port** changes to newer release
390
+ branches all the way up to ` master ` .
391
+ * The merge forward can be done with ` git merge ` in order to keep the commit history.
392
+ For example:
393
+
394
+ git checkout ign-<library>M
395
+ git pull
396
+ git checkout ign-<library>N
397
+ git pull
398
+ git checkout -b M_to_N_<date> # It's important to do this before `git merge`
399
+ git merge ign-<library>M
400
+ # Fix conflicts
401
+ git commit -sam"Merge M into N"
402
+ # Open pull request
403
+
404
+ * In the rare event that a pull request needs to be backported (i.e. from a
405
+ higher version to a lower version), use ` git cherry-pick ` , for example:
406
+
407
+ git checkout ign-<library>N
408
+ git pull
409
+ git checkout ign-<library>M
410
+ git pull
411
+ git checkout -b N_to_M_<date>
412
+ git cherry-pick <commits from verrsion N>
413
+ # Fix conflicts
414
+ git commit -sam"Backport from N to M"
415
+ # Open pull request
416
+
417
+ * When merging a port pull request, ** do not squash or rebase** , create a merge
418
+ commit instead.
382
419
383
420
## Writing Tests
384
421
0 commit comments