| 1234567891011121314151617181920212223242526272829303132333435363738 | #!/bin/bash## Move the "bump to <version>" commit to the HEAD of the branch#. "$(dirname "${BASH_SOURCE[0]}")/utils.sh"function usage() {    >&2 cat << EOMMove the "bump to <version>" commit to the HEAD of the branchThis script requires that 'git config branch.${BRANCH}.release' is set to therelease version for the release branch.EOM    exit 1}BRANCH="$(git rev-parse --abbrev-ref HEAD)"VERSION="$(git config "branch.${BRANCH}.release")" || usageCOMMIT_MSG="Bump $VERSION"sha="$(git log --grep "$COMMIT_MSG\$" --format="%H")"if [ -z "$sha" ]; then    >&2 echo "No commit with message \"$COMMIT_MSG\""    exit 2fiif [[ "$sha" == "$(git rev-parse HEAD)" ]]; then    >&2 echo "Bump commit already at HEAD"    exit 0ficommits=$(git log --format="%H" "$sha..HEAD" | wc -l | xargs echo)git rebase --onto $sha~1 HEAD~$commits $BRANCHgit cherry-pick $sha
 |