Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# FORK from containerd/containerd main

Only make changes to contrib/cherry-pick-prs.sh

![containerd banner light mode](https://raw.githubusercontent.com/cncf/artwork/master/projects/containerd/horizontal/color/containerd-horizontal-color.png#gh-light-mode-only)
![containerd banner dark mode](https://raw.githubusercontent.com/cncf/artwork/master/projects/containerd/horizontal/white/containerd-horizontal-white.png#gh-dark-mode-only)

Expand Down
76 changes: 76 additions & 0 deletions contrib/cherry-pick-prs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash
# Cherry-pick GitHub PRs into current branch
#
# Usage: Edit the invocations below, then run this script

set -e

cherry_pick_pr() {
local repo=$1
local pr=$2
local pr_branch="pr-${repo//\//-}-$pr"

echo "=================================================="
echo "Cherry-picking $repo#$pr"
echo "=================================================="

# Fetch the PR
echo "Fetching PR #$pr from $repo..."
if ! git fetch "https://github.com/$repo" "pull/$pr/head:$pr_branch"; then
echo "Error: Failed to fetch PR #$pr from $repo"
return 1
fi

# Get merge base and commits (skip merge commits)
local merge_base=$(git merge-base HEAD "$pr_branch")
local commits=$(git rev-list --reverse --no-merges "$merge_base..$pr_branch")
local count=$(echo "$commits" | wc -l)

echo "Found $count commit(s) to cherry-pick"
echo ""
git --no-pager log --oneline "$merge_base..$pr_branch"
echo ""

# Cherry-pick each commit
for commit in $commits; do
echo "Cherry-picking: $(git log -1 --oneline $commit)"
if ! git cherry-pick --empty=drop "$commit"; then
echo ""
echo "Error: Cherry-pick failed!"
echo "Resolve conflicts, then run:"
echo " git cherry-pick --continue # or --skip or --abort"
git branch -D "$pr_branch" 2>/dev/null || true
exit 1
fi
done

echo "✓ Successfully cherry-picked $repo#$pr"
echo ""

# Cleanup
git branch -D "$pr_branch" 2>/dev/null || true
}

echo "Current branch: $(git branch --show-current)"
echo ""

# ============================================================================
# Edit this section to add/remove PRs to cherry-pick
# ============================================================================

# cherry_pick_pr <owner/repo> <pr_number>
#
# The following PRs have been merged to upstream main and are included via rebase:
# #12821, #12836, #12849, #12868, #12913, #12916, #12923, #12928
#
# Only cherry-pick PRs that are still open:
cherry_pick_pr containerd/containerd 12608
cherry_pick_pr containerd/containerd 12562 # This also contains a commit from 12608, but that's fine since it will be skipped
cherry_pick_pr containerd/containerd 12667
cherry_pick_pr containerd/containerd 12785
cherry_pick_pr containerd/containerd 12865
cherry_pick_pr dmcgowan/containerd 11 # This needs a PR on containerd/containerd still
cherry_pick_pr containerd/containerd 12921 # sys, dialer: support AF_UNIX sockets on Windows
cherry_pick_pr containerd/containerd 12938 # mount/manager: set sparse file attribute on Windows before mkfs