Skip to content

Commit 11fec13

Browse files
authored
Add section about forward-porting PRs (gazebosim#33)
* Add section about forward-porting PRs and πŸ’πŸ‘Œ backwards Signed-off-by: Louise Poubel <louise@openrobotics.org>
1 parent c7e854f commit 11fec13

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

β€Žcontributing.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,45 @@ Merging strategy:
377377
* Default to β€œsquash and merge”
378378
* Make sure the commit message captures the core ideas of the pull request.
379379
* β€œRebase and merge” when moving files (do a `git mv` as a separate commit)
380+
* β€œCreate a merge commit” when porting changes across branches
380381
* Refrain from force-pushing while the PR is under review (which includes rebasing and squashing)
381382

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.
382419

383420
## Writing Tests
384421

0 commit comments

Comments
Β (0)