Skip to content

Instantly share code, notes, and snippets.

@webmozart
Created November 15, 2012 14:32
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webmozart/4078901 to your computer and use it in GitHub Desktop.
Save webmozart/4078901 to your computer and use it in GitHub Desktop.
Script to find the merge and PR a commit occurred in
#!/bin/bash
COMMIT=$1
BRANCH=$2
if [ -z $BRANCH ]; then
BRANCH="master"
fi
perl -ne 'print if ($seen{$_} .= @ARGV) =~ /10$/' \
<(git rev-list --ancestry-path --oneline $COMMIT..$BRANCH) \
<(git rev-list --first-parent --oneline $COMMIT..$BRANCH) \
| tail -n 1
#!/bin/bash
git-find-merge $1 $2 \
| cut -d '#' -f2 \
| cut -c1-4 \
| sed 's/^/https:\/\/github.com\/symfony\/symfony\/pull\//'
@jsgarvin
Copy link

Nudge @fabpot 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment