Created
September 4, 2015 21:10
-
-
Save nelsonsar/af929d452dc8066ec28d to your computer and use it in GitHub Desktop.
Calculate distance between HEAD and a given hash
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 | |
COUNTER=1 | |
for i in $(git log --oneline | cut -d" " -f 1); do | |
let COUNTER+=1 | |
if [ "$i" = "$1" ]; then | |
echo "$COUNTER" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment