Better way to find commit from tarball?
From: Todd A. Jacobs <hidden>
Date: 2016-06-15 22:49:30
Someone handed me a tarball that represented an unknown release from a
project. Here's what I came up with to identify the commit:
cd $SOME_WORK_DIR
find . -path ./.git -prune -o -print0 | xargs -0 rm
tar xvfz $TARBALL
for commit in {0..100}; do
id="master~${commit}"
if git diff --quiet --exit-code "$id"
then
echo "Matched on commit $id"
break
fi
done
Someone please tell me there's an easier way to find a matching tree
when handed a tarball. This works, but seems cumbersome.