Skip to content

Instantly share code, notes, and snippets.

@dgnorton
Created March 29, 2019 14:57
Show Gist options
  • Save dgnorton/198eb2381a98e897216d485daf5a4d1c to your computer and use it in GitHub Desktop.
Save dgnorton/198eb2381a98e897216d485daf5a4d1c to your computer and use it in GitHub Desktop.
#!/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