Skip to content

Instantly share code, notes, and snippets.

@timblair
Created February 19, 2014 19:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timblair/9099984 to your computer and use it in GitHub Desktop.
Save timblair/9099984 to your computer and use it in GitHub Desktop.
Show the point where a given commit was merged into master
#!/bin/bash
# Displays the point at which a given commit SHA was merged
#
# Usage: git merge-point SHA <TARGET>
TARGET=${2-master}
git rev-list --ancestry-path $1..$TARGET |
grep -f <(git rev-list --first-parent $1..$TARGET) |
tail -n 1 |
xargs git --no-pager show --shortstat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment