Last active
August 29, 2015 14:03
-
-
Save kostia/b78a3c1a1c988e49335f to your computer and use it in GitHub Desktop.
Open Github-PR for a given SHA1 of a commit
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
#!/usr/bin/env bash | |
# Based on https://github.com/mhagger/git-when-merged. | |
# Usage: git open-pr <SHA1> | |
commit_sha1=`git when-merged $1|tr -s ' '|cut -d' ' -f2` | |
commit_pr_number=`git show $commit_sha1|grep 'Merge pull request'|cut -d'#' -f2|cut -d' ' -f1` | |
open "https://github.com/infopark/rails_connector/pull/$commit_pr_number" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment