Skip to content

Commit

Permalink
Cherry pick merge commit instead of original commits (#5904)
Browse files Browse the repository at this point in the history
cherry_pick_pull.sh was copied from Kubernetes which allows merge
commits. It makes sense to cherry pick original commits for Kubernetes
because the original commits can be found in both master and release
branches. However, Antrea uses squash merging at the most time,
cherry-picking original commits would cause inconsistency between master
and release branches. The commit changes to cherry pick the merge
commit.

Signed-off-by: Quan Tian <[email protected]>
  • Loading branch information
tnqn authored Jan 26, 2024
1 parent e8b516f commit f3ffa7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hack/cherry-pick-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ gitamcleanup=true
for pull in "${PULLS[@]}"; do
echo "+++ Downloading patch to /tmp/${pull}.patch (in case you need to do this again)"

curl -o "/tmp/${pull}.patch" -sSL "https://github.com/${MAIN_REPO_ORG}/${MAIN_REPO_NAME}/pull/${pull}.patch"
merge_commit=$(gh pr view "$pull" --json mergeCommit -t '{{(printf "%s" $.mergeCommit.oid)}}')
curl -o "/tmp/${pull}.patch" -sSL "https://github.com/${MAIN_REPO_ORG}/${MAIN_REPO_NAME}/commit/${merge_commit}.patch"
echo
echo "+++ About to attempt cherry pick of PR. To reattempt:"
echo " $ git am -3 /tmp/${pull}.patch"
Expand Down

0 comments on commit f3ffa7b

Please sign in to comment.