Created
September 28, 2023 13:57
-
-
Save freyes/c831ad8cf588de6af4736149d3846510 to your computer and use it in GitHub Desktop.
Helper script to propose backports for OpenStack projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eux | |
# | |
# Usage: | |
# ./git-cherry-pick-openstack <COMMIT> <TOPIC> <TARGET> | |
# | |
# Example: | |
# ./git-cherry-pick-openstack 83ffa9eb3a2418897bf2707d14efce725d775090 bug/2030094 ussuri | |
COMMIT_ID=${1} | |
TOPIC=${2} | |
TARGET=${3} | |
CLI_ARGS=( "$@" ) | |
REVIEW="${CLI_ARGS[@]:3}" | |
git checkout stable/${TARGET} || echo "Already in the desired branch" | |
git pull | |
git checkout -b ${TOPIC}-${TARGET} | |
git cherry-pick -x ${COMMIT_ID} | |
git review -t ${TOPIC} $REVIEW | |
git checkout master | |
git branch -D ${TOPIC}-${TARGET} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment