Last active
December 20, 2015 14:59
-
-
Save davejachimiak/6150800 to your computer and use it in GitHub Desktop.
Get merge commit created by Github when you open a pull request from a branch (`my_branch`)
This file contains 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
REMOTE_SHA=`git rev-parse origin/my_branch` | |
PULL_NUMBER=`git ls-remote origin | grep $REMOTE_SHA | grep pull | perl -n -e '/pull\/(.*)\/head/ && print $1'` | |
git ls-remote origin | grep refs\/pull\/$PULL_NUMBER\/merge | awk '{ print $1 };' |
I really just don't want to have to write all this code: https://github.com/davejachimiak/fuci/blob/0458b0327a626a7b95d4d206e4fa2fe37605dac5/lib/fuci/git.rb#L9-L12
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well, the second comment here is thought provoking: StackOverflow