Skip to content

Commit 6636a78

Browse files
committed
GH-704 - Improve back-port script to cherry pick all commits associated to the source ticket.
1 parent 780e4bc commit 6636a78

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

etc/create-backport-tickets.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,19 @@ do
1616
# Turn 1.5.6 into 1.5.x
1717
targetBranch="$(echo "$version" | grep -oE '^[0-9]+\.[0-9]+').x"
1818

19+
# The SHAs of all commits associated with the source ticket
20+
shas=$(git log --grep="$sourceGh" --reverse --format="%H")
21+
1922
# Checkout target branch and cherry-pick commit
2023
echo "Checking out branch $targetBranch"
2124
git checkout $targetBranch
2225

23-
echo "Cherry-pick commit from $branch"
24-
git cherry-pick $branch
26+
# Cherry-pick all previously found SHAs
27+
while IFS= read -r sha
28+
do
29+
echo "Cherry-pick commit $sha from $branch"
30+
git cherry-pick $sha
31+
done <<< $shas
2532

2633
echo "gh issue create --title \"$title\" --body \"Back-port of $sourceGh.\" --label \"$labels\" --assignee \"@me\" --milestone \"$version\""
2734
number=$(gh issue create --title "$title" --body "Back-port of $sourceGh." --label "$labels" --assignee "@me" --milestone "$version" | awk -F '/' '{print $NF}')

0 commit comments

Comments
 (0)