Skip to content

Instantly share code, notes, and snippets.

@necronet
Created March 31, 2021 00:01
Show Gist options
  • Save necronet/2d43da09583884236683918824b3db9a to your computer and use it in GitHub Desktop.
Save necronet/2d43da09583884236683918824b3db9a to your computer and use it in GitHub Desktop.
Open PR for a specific commit
# Get PR number for a specific commit
local pr_number=$(git log --reverse --ancestry-path <commit_id>..master --grep="Merge pull request" --oneline | head -n 1 | awk '{print $5}' | sed -E 's/#//g')
# Open PR in the browser
open "https://github.tumblr.net/TumblrMobile/android2/pull/$pr_number"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment