Created
February 27, 2010 02:44
-
-
Save schwern/316423 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Find the child of the current (or supplied) commit. | |
REV=$1 | |
if [ x$REV == x ]; then | |
REV="HEAD" | |
fi | |
HASH=$(git-rev-parse $REV) | |
NUM=$2 | |
if [ x$NUM == x ]; then | |
NUM=1 | |
fi | |
git rev-list --all --parents | grep " $HASH" | sed -n "${NUM}s/\([^ ]*\) .*$/\\1/p" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment