@@ -163,7 +163,7 @@ get acquainted with this development process.
163
163
1 . ** Choose a base branch.**
164
164
- If your changes will break API or ABI, then base your new branch off of ` main ` .
165
165
- If you are making interdependent changes to multiple repositories without
166
- breaking API or ABI, it is also recommended to base your new branches of of ` main `
166
+ breaking API or ABI, it is also recommended to base your new branches off of ` main `
167
167
to simplify automated testing of the changes and the review process. Your
168
168
changes may be backported to an existing release once all the changes
169
169
have been merged.
@@ -381,11 +381,32 @@ Merging strategy:
381
381
382
382
Porting changes across branches:
383
383
384
- * Pull requests should target the lowest possible
385
- [ supported version] ( releases ) where the
384
+ * Pull requests should target the latest [ supported version] ( releases ) where the
386
385
changes can be added in a backwards-compatible way (no API / ABI / behavior
387
386
break in released branches).
388
- * Periodically, a maintainer will ** forward-port** changes to newer release
387
+ * To backport a pull request (i.e. from a higher version to a lower version),
388
+ use ` git cherry-pick ` instead of ` git merge ` , for example:
389
+
390
+ git checkout gz-<library>N
391
+ git pull
392
+ git checkout gz-<library>M
393
+ git pull
394
+ git checkout -b N_to_M_<date>
395
+ git cherry-pick <commits from verrsion N>
396
+ # Fix conflicts
397
+ git commit -sam"Backport from N to M"
398
+ # Open pull request
399
+ # Do not squash, rebase instead
400
+
401
+ Alternatively, you can use ` mergify ` to create backports. Go to the original
402
+ pull request and add a comment:
403
+
404
+ @mergifyio backport gz-<library>M
405
+
406
+ where ` M ` is the version to backport to.
407
+
408
+ * In certain cases when a pull request is merged into an older release branch,
409
+ a maintainer will ** forward-port** changes to newer release
389
410
branches all the way up to ` main ` .
390
411
* See [ this list] ( https://github.com/gazebosim/docs/blob/master/tools/branch_comparisons.md ) to check if a branch needs porting.
391
412
* The merge forward can be done with ` git merge ` in order to keep the commit history
@@ -402,20 +423,6 @@ Porting changes across branches:
402
423
# Open pull request
403
424
# Do not squash or rebase, create a merge commit
404
425
405
- * In the rare event that a pull request needs to be backported (i.e. from a
406
- higher version to a lower version), use ` git cherry-pick ` instead of ` git merge ` ,
407
- for example:
408
-
409
- git checkout gz-<library>N
410
- git pull
411
- git checkout gz-<library>M
412
- git pull
413
- git checkout -b N_to_M_<date>
414
- git cherry-pick <commits from verrsion N>
415
- # Fix conflicts
416
- git commit -sam"Backport from N to M"
417
- # Open pull request
418
- # Do not squash, rebase instead
419
426
420
427
## Writing Tests
421
428
0 commit comments