aboutsummaryrefslogtreecommitdiff
path: root/branch.sh
blob: 315840bc43c289bd46002ab07fa4396b19ccb3c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
 
best=9999999999
tag=""
 
for commit in $(git tag -l "*8960*")
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