From aa0e6ea99a1e3ca1b0d654cbcb73ef6b6bc732d2 Mon Sep 17 00:00:00 2001 From: Shintaro Kawamura Date: Wed, 17 Jan 2024 14:16:16 +0900 Subject: [PATCH] doc: how to cherry-pick to release branch BUG=none TEST=mdbook serve Change-Id: Ie21d9e3c8e575785d0907b5a39bcb8bca1d5e8f6 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5201654 Commit-Queue: Shin Kawamura Reviewed-by: Keiichi Watanabe --- docs/book/src/integration/chromeos.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/book/src/integration/chromeos.md b/docs/book/src/integration/chromeos.md index b3f57c29d9..192b103a1b 100644 --- a/docs/book/src/integration/chromeos.md +++ b/docs/book/src/integration/chromeos.md @@ -107,6 +107,8 @@ If it cannot be avoided at all, please follow this process: ## Cherry-picking +### Cherry-picking without the usual merge process + If you need your changes faster than the usual merge frequency, please follow this process: 1. Upload and submit your change to upstream crosvm. @@ -116,6 +118,30 @@ If you need your changes faster than the usual merge frequency, please follow th **Never** submit code just to ChromeOS, as it will cause upstream to diverge and result in merge conflicts down the road. +### Cherry-picking to release branch + +Your change need to be merged into [chromiumos/platform/crosvm] to cherry-pick it to a release +branch. You should follow +[ChromiumOS Merge Workflow](https://chromium.googlesource.com/chromiumos/docs/+/HEAD/work_on_branch.md) +to cherry-pick your changes. Since changes are merged from [crosvm/crosvm] to +[chromiumos/platform/crosvm] through [the merge process](#the-merge-process), you can't use gerrit +to cherry-pick your changes but need to use git command locally. + +``` +$ cd chromiumos/src/platform/crosvm +$ git branch -a | grep remotes/cros/release-R120 + remotes/cros/release-R120-15662.B +$ git checkout -b my-cherry-pick cros/release-R120-15662.B +$ git cherry-pick -x $COMMIT +$ git push cros HEAD:refs/for/release-R120-15662.B +``` + +`$COMMIT` is the commit hash of the original change you want to cherry-pick not the merge commit. +Note that you push to special gerrit `refs/for/`, not pushing directly to the release branch. + +Also note that release branch cherry picks don't get CQ tested at all - they are submitted directly +once you CQ+2 - so it is very important to test locally first. + ## Running a Tryjob For googlers, see go/cdg-site