Skip to content

Instantly share code, notes, and snippets.

@duffn
Last active December 29, 2019 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duffn/796f961c98c27f008c789b5e19afe641 to your computer and use it in GitHub Desktop.
Save duffn/796f961c98c27f008c789b5e19afe641 to your computer and use it in GitHub Desktop.
Get GitHub PRs from commits between two branches
export STAGING=staging
export MASTER=master
export REPO=https://github.com/yourorg/yourrepo/pull/
git log --oneline $(git log -n 1 --pretty=format:"%H" $STAGING)...$(git log -n 1 --pretty=format:"%H" $MASTER) | grep -E '#[0-9]+' | gawk -v REPO="$REPO" 'match($0, /#([0-9]+)/, arr) {$1=""; print substr($0,2) "\t" REPO arr[1]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment