From b13f052be7866b66041647c43f901b775c5523c3 Mon Sep 17 00:00:00 2001 From: Alex Sepkowski Date: Tue, 23 Jun 2026 09:39:22 -0700 Subject: [PATCH 1/4] Add Copilot instructions for cherry-picking commits Document the convention for cherry-pick PRs: cherry-pick commits (not PRs) using git cherry-pick -x, prefix PR titles with [Cherry-Pick], and make the PR description match the cherry-picked commit message verbatim so the squash-merge commit message is correct. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000000..738300bfa2 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,51 @@ +# GitHub Copilot Instructions + +These instructions guide GitHub Copilot and other AI coding agents when working +in this repository. + +## Cherry-picking commits + +When cherry-picking a change (for example, backporting a fix to a release +branch): + +1. **Cherry-pick commits, not PRs.** Identify the specific commit SHA to + cherry-pick. If the source PR was squash-merged, that is the single squashed + commit produced on the target branch. +2. **Use `git cherry-pick -x`** so the new commit message records the source + commit in the standard git format: + + ``` + (cherry picked from commit ) + ``` + +3. **Create a topic branch** off the destination branch and apply the + cherry-pick there. +4. **Open the PR** with: + - **Title:** start with `[Cherry-Pick]`, followed by the cherry-picked + commit's subject line. For example: + + ``` + [Cherry-Pick] + ``` + + - **Description:** the cherry-picked commit's message body verbatim, + including the trailing `(cherry picked from commit )` line. Because + PRs are squash-merged, the PR description becomes the merge commit message, + so it must match the cherry-picked commit message. + +### Example + +Title: + +``` +[Cherry-Pick] Fix cast between semantically different integer types (#8414) +``` + +Description: + +``` +This patch fixes 2 instances of internal issues; C6214: Cast between +semantically different integer types. + +(cherry picked from commit 32beebfd584c59662392779184240c6d407d5346) +``` From af0795fee888a50b1e66fef03ac064a3ce8bc41f Mon Sep 17 00:00:00 2001 From: Alex Sepkowski Date: Tue, 23 Jun 2026 10:19:00 -0700 Subject: [PATCH 2/4] Simplify cherry-pick Copilot instructions Per review feedback, trim the cherry-pick guidance to the essentials: use git cherry-pick -x and keep git's default commit message, dropping the topic-branch and verbatim-description boilerplate that added too much text to every prompt. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 52 +++------------------------------ 1 file changed, 4 insertions(+), 48 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 738300bfa2..08dce1cbd1 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,51 +1,7 @@ # GitHub Copilot Instructions -These instructions guide GitHub Copilot and other AI coding agents when working -in this repository. +## Cherry-picking -## Cherry-picking commits - -When cherry-picking a change (for example, backporting a fix to a release -branch): - -1. **Cherry-pick commits, not PRs.** Identify the specific commit SHA to - cherry-pick. If the source PR was squash-merged, that is the single squashed - commit produced on the target branch. -2. **Use `git cherry-pick -x`** so the new commit message records the source - commit in the standard git format: - - ``` - (cherry picked from commit ) - ``` - -3. **Create a topic branch** off the destination branch and apply the - cherry-pick there. -4. **Open the PR** with: - - **Title:** start with `[Cherry-Pick]`, followed by the cherry-picked - commit's subject line. For example: - - ``` - [Cherry-Pick] - ``` - - - **Description:** the cherry-picked commit's message body verbatim, - including the trailing `(cherry picked from commit )` line. Because - PRs are squash-merged, the PR description becomes the merge commit message, - so it must match the cherry-picked commit message. - -### Example - -Title: - -``` -[Cherry-Pick] Fix cast between semantically different integer types (#8414) -``` - -Description: - -``` -This patch fixes 2 instances of internal issues; C6214: Cast between -semantically different integer types. - -(cherry picked from commit 32beebfd584c59662392779184240c6d407d5346) -``` +Use `git cherry-pick -x` for cherry picks so the commit message records the +source commit SHA. Keep the cherry-pick commit message as git generates it by +default, and prefix the PR title with `[Cherry-Pick]`. From 2d2865f21157c88ef8486ddb9fb63cce86ef1bbf Mon Sep 17 00:00:00 2001 From: Alex Sepkowski Date: Tue, 23 Jun 2026 14:53:52 -0700 Subject: [PATCH 3/4] Provide cherry-pick guidance as a skill instead of instructions Per review feedback, move the cherry-pick convention out of .github/copilot-instructions.md (which is injected into every prompt) and into an on-demand skill at .github/skills/cherry-pick/SKILL.md. The skill is auto-discovered from the repo and only loaded when relevant, keeping it out of unrelated prompts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 7 ------- .github/skills/cherry-pick/SKILL.md | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) delete mode 100644 .github/copilot-instructions.md create mode 100644 .github/skills/cherry-pick/SKILL.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md deleted file mode 100644 index 08dce1cbd1..0000000000 --- a/.github/copilot-instructions.md +++ /dev/null @@ -1,7 +0,0 @@ -# GitHub Copilot Instructions - -## Cherry-picking - -Use `git cherry-pick -x` for cherry picks so the commit message records the -source commit SHA. Keep the cherry-pick commit message as git generates it by -default, and prefix the PR title with `[Cherry-Pick]`. diff --git a/.github/skills/cherry-pick/SKILL.md b/.github/skills/cherry-pick/SKILL.md new file mode 100644 index 0000000000..b593bab022 --- /dev/null +++ b/.github/skills/cherry-pick/SKILL.md @@ -0,0 +1,23 @@ +--- +name: cherry-pick +description: Cherry-pick a commit onto another branch and open the PR. Use when the user asks to cherry-pick or backport a commit or PR to a release branch. +--- + +# Cherry-picking commits + +Use this when asked to cherry-pick or backport a change. + +1. Identify the source commit SHA to cherry-pick. If the source PR was + squash-merged, the single squashed commit on the target branch is what you + cherry-pick. +2. Create a topic branch off the destination branch. +3. Apply the change with `git cherry-pick -x ` so the commit message + records the source commit in git's standard format: + + ``` + (cherry picked from commit ) + ``` + + Keep the cherry-pick commit message as git generates it by default. +4. Open the PR with the title prefixed `[Cherry-Pick]`, followed by the + original commit subject. From cba03d1e8d8b80ef85208a4566cfd36258f70616 Mon Sep 17 00:00:00 2001 From: Alex Sepkowski Date: Tue, 23 Jun 2026 14:56:34 -0700 Subject: [PATCH 4/4] Trim cherry-pick skill body to essentials Drop the topic-branch and squash-merge boilerplate from the skill body since the agent already knows those steps; keep only the non-obvious conventions (git cherry-pick -x, keep git's default message, [Cherry-Pick] title prefix). The descriptive frontmatter is retained so the skill still triggers reliably. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/skills/cherry-pick/SKILL.md | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/skills/cherry-pick/SKILL.md b/.github/skills/cherry-pick/SKILL.md index b593bab022..d06868b940 100644 --- a/.github/skills/cherry-pick/SKILL.md +++ b/.github/skills/cherry-pick/SKILL.md @@ -5,19 +5,6 @@ description: Cherry-pick a commit onto another branch and open the PR. Use when # Cherry-picking commits -Use this when asked to cherry-pick or backport a change. - -1. Identify the source commit SHA to cherry-pick. If the source PR was - squash-merged, the single squashed commit on the target branch is what you - cherry-pick. -2. Create a topic branch off the destination branch. -3. Apply the change with `git cherry-pick -x ` so the commit message - records the source commit in git's standard format: - - ``` - (cherry picked from commit ) - ``` - - Keep the cherry-pick commit message as git generates it by default. -4. Open the PR with the title prefixed `[Cherry-Pick]`, followed by the - original commit subject. +Cherry-pick the commit with `git cherry-pick -x ` so the source SHA is +recorded in git's standard format. Keep the commit message as git generates it +by default. Prefix the PR title with `[Cherry-Pick]`. \ No newline at end of file