Backporting example for 0.19.x.
Original Backporting issues is here
- Everything is merged in master:
- For an issue/PR: discuss if it should go into a bug fix release, and if so: tag it with the appropriate milestone (in this case: 0.19.1)
- PR tagged with 0.19.1 still targets master, but is written as it is for 0.19.1 (whatsnew notice in the 0.19.1 file, mentioning this release number where needed)
- PR is merged into master
- Backport to 0.19.x branch:
-
Backport branch 0.19.x can be branched of master just before the point the first commit is added to master that should not be included in the bugfix release
- After branching, master should be tagged with 0.20.0.dev, to ensure correct version number ordering. (see https://github.com/pandas-dev/pandas/issues/14352#issuecomment-292335463)
-
The one resulting commit of the PR is backported to the 0.19.x branch using cherry-pick and fix conflicts when needed (in practice this was almost never needed for the 0.19.x releases). So I mainly did:
git checkout 0.19.x git cherry-pick ..commit-sha.. -
In practice, what I did was the following:
- Go through the history of master (from where 0.19.x was branched to more recent), check for each commit whether it needs backporting (based on tag of connected PR, at once extra check this tagging was actually correct based), and if so copy sha and cherry-pick it.
- I did this a couple times for a whole bunch at once, and you can just check the latest commit in the 0.19.x branch where you left off the previous time.
-
I also had a script that could automate this a little bit, but in practice it didn't give much value above using the cherry-pick (you could give the PR number instead of the commit sha). But in theory, we could write a script that gets all PRs, check that they were tagged with the specific release, and cherry-pick them in order, to automate this (supposing all changes went through PRs). But not sure this is worth the effort. What I used then is here: https://gist.github.com/jorisvandenbossche/e97c22f7176180a5548f767e520586bb#file-backport-pr-py-L113-L126