Created
March 29, 2019 14:57
-
-
Save dgnorton/198eb2381a98e897216d485daf5a4d1c 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 | |
commit="$1" | |
for tag in $(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname)'); do | |
t1="$t2" | |
t2="$(echo $tag | awk -F/ '{print $3}')" | |
if [ -z $t1 ]; then | |
continue | |
fi | |
found="$(git log --pretty=oneline $t1..$t2 | grep $commit | wc -l)" | |
if [ ! -z "$found" ]; then | |
echo "found commit $commit in release $t2" | |
exit 0 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment