Skip to content

Instantly share code, notes, and snippets.

@tangphillip
Created September 25, 2012 05:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tangphillip/60cf16f6f96e4a224232 to your computer and use it in GitHub Desktop.
Save tangphillip/60cf16f6f96e4a224232 to your computer and use it in GitHub Desktop.
Find that Pull Request!
#!/bin/zsh
# Dependency: hub: https://github.com/defunkt/hub
find_pull_request()
{
git rev-list --ancestry-path --reverse --grep="pull request" $1~1..HEAD | head -n 1 | xargs git cat-file commit | grep "pull request" | head -n 1 | sed "s/^.*#/pull\//" | sed "s/ .*$//" | xargs hub browse --
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment