Skip to content

Instantly share code, notes, and snippets.

@invisiblek
Created March 23, 2015 22:39
Show Gist options
  • Save invisiblek/f1f5ae60b88e5bf6c07d to your computer and use it in GitHub Desktop.
Save invisiblek/f1f5ae60b88e5bf6c07d to your computer and use it in GitHub Desktop.
#!/bin/bash
# Extract your stock source and cd to it
# git init
# git add .
# git commit -m "initial import from <vendor> - <version>"
# git remote add caf git://codeaurora.org/quic/la/kernel/msm
# git fetch caf
# tagfinder
best=9999999999
tag=""
for commit in $(git tag -l "*LNX*")
do
match=$(git diff $commit --shortstat --diff-filter M | awk -F' ' '{print $4 + $6}')
echo $commit has $match lines changed
if [ $match -lt $best ]; then
best=$match
tag=$commit
echo $tag is the new best match with $best lines changed
fi
done
echo "Best match"
echo TAG : $tag
echo Lines Changed : $best
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment