Skip to content

Instantly share code, notes, and snippets.

@arssher
Created October 19, 2023 10:10
Show Gist options
  • Select an option

  • Save arssher/50e1aad2b4a3a62161802713835f0f9a to your computer and use it in GitHub Desktop.

Select an option

Save arssher/50e1aad2b4a3a62161802713835f0f9a to your computer and use it in GitHub Desktop.
#!/bin/bash
## usage: stand on commit and run, e.g.
# git checkout rm-ws-logging-v16 && branch=rm-ws-logging backpatch_neon.sh
set -e
# set -o xtrace # print each line
commit=$(git rev-parse HEAD)
echo "applying ${commit}"
versions="14 15"
if [ -z "$branch" ]; then
echo "branch not specified"
exit 1
fi
git fetch
for v in $versions; do
stable_branch="REL_${v}_STABLE_neon"
echo "Working on ${stable_branch}"
git checkout ${stable_branch}
git branch --set-upstream-to=origin/${stable_branch} ${stable_branch}
git pull
pr_branch="${branch}-v${v}"
git branch -D ${pr_branch} || true
git checkout -b ${pr_branch}
git cherry-pick "${commit}"
echo "patched ${pr_branch}"
git pf
gh pr create --fill --base ${stable_branch}
exit 0
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment