cherry-pick-pr 538 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. #
  3. # Cherry-pick a PR into the release branch
  4. #
  5. set -e
  6. set -o pipefail
  7. function usage() {
  8. >&2 cat << EOM
  9. Cherry-pick commits from a github pull request.
  10. Usage:
  11. $0 <github PR number>
  12. EOM
  13. exit 1
  14. }
  15. [ -n "$1" ] || usage
  16. if [ -z "$(command -v hub 2> /dev/null)" ]; then
  17. >&2 echo "$0 requires https://hub.github.com/."
  18. >&2 echo "Please install it and make sure it is available on your \$PATH."
  19. exit 2
  20. fi
  21. REPO=docker/compose
  22. GITHUB=https://github.com/$REPO/pull
  23. PR=$1
  24. url="$GITHUB/$PR"
  25. hub am -3 $url