Last active
December 29, 2019 17:59
-
-
Save duffn/796f961c98c27f008c789b5e19afe641 to your computer and use it in GitHub Desktop.
Get GitHub PRs from commits between two branches
This file contains hidden or 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
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]}' |
This file contains hidden or 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
git log --date=short --pretty=format:"%h%x09%an%x09%ad%x09%s" $(git log -n 1 --pretty=format:"%H" master)...$(git log -n 1 --pretty=format:"%H" staging) | grep -E '#[0-9]+' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment