Skip to main content

Backport guide

Don't forget, using Gerrit is a bit different than other systems.

single commits

try git cherry-pick -x first. if this works, excellent. if not, apply the usual cherry-picking procedures:

  • track down apply failures to intermediate changes. maybe cherry-pick those first if they're not too awful, but experience shows that they usually are too awful
  • anything that touches the store or contains the word Accessor in the vicinity probably needs to be picked about and rewritten from scratch
  • always test ofc, even if something applies cleanly it will sometimes just fail to build (or worse, run)
  • nix prs tend to have broken inner commits. it is often necessary to pick parts from later commits in a pr to fix ci, in that case note this down as fixes taken from <commits...>
  • sometimes a commit may be so broken that it can't reasonably be fixed except by squasing it with some other commit, in that case just squash them and not it down somehow (either with multiple cherry picked from commit hashes or multiple commit message+cherry-pick-hash blocks, depending on whether the fix messages were any useful)

full prs

single-commit prs were mostly picked using cherry-pick -x -m1 to keep the association with the upstream pr number for clarity. this implicitly squashes the pr into a single commit so it's only useful for single-commit prs. (some prs that have broken intermediate commits also benefit from this, but see above for that)

when pushing these to gerrit please set a topic like backport-<pr-number> using push options (-o topic=backport-<pr-number> in git push) to delineate one picked pr from a pr that depends on it