...
Skara features a way to declare a pull request to be a "backport pull request" in order to ease the creation of backport commits. A "backport pull request" is a pull request which title is of the form "Backport [0-9a-z]{40}", for example "Backport 5a526c1c5716f6d9a7fc94741bcdb2f424d342df". The hash represents the git hash of the original commit that is being backported. When the Skara bots encounter a "backport pull request" then they will:
...
The /backport commit command can be used to quickly create a backport pull request for a given commit. Just navigate to the commit in source code hosting provider's web UI and add a comment consisting of /backport <repo> [<branch>]
. If the commit does not apply clean on the target repository then a message will be shown for the files with conflicts.
Workflow
Creating backports
Web UI
Navigate the to commit indented to be backported in the source code hosting provider's web UI and issue the /backport commit command. If the commit applied cleanly onto the target repository then go to the pull request linked in the reply and issue the /integrate pull request command.
If the commit did not apply cleanly then the commit must be backport manually and backport pull request must be created manually. See the CLI section for an example of how to do this using the command-line.
CLI
Use the Skara CLI tool git-backport to try to automatically create a backport pull request for the given commit, for example:
...
The output from the final git push
will return a link that can be used to create the pull request.
Backporting from mercurial
If you want to backport a mercurcial changeset, note that you should be able to find the corresponting git commit by searching git's commit history. You can for example do `git log | grep <jbs-issue-id>`, or search for the `<jbs-issue-id>` in the source code hosting provider's web UI.
Changed paths and renamed files
Some file paths are significantly different between jdk8 and higher. This can make it hard for git to apply a backport patch, it might give errors connected to "rename detection". unshuffle_patch.sh is a script that changes file paths in a patch, to account for the layout changes between 8 and 11. The current state of this script is known to be incomplete to some extent, but it can still be valuable.