blob: 5ef75dbffeb8c34fc08deb53687d82ade73c6a68 [file] [log] [blame]
#!/bin/bash
. show-missing-iter
function applies {
git cherry-pick $1 &> /dev/null
if [ $? -eq 0 ]; then
echo "+"
git reset --hard HEAD^ &> /dev/null
else
echo "-"
git reset --hard &> /dev/null
fi
}
function handle_stable {
others=$(stable find-alts $1)
app=$(applies $1)
if [ "$others" != "" ]; then
printf "[E$app] %s\n" "$(git log -1 --oneline $1)"
subj=$(git log -1 --pretty="%s" $1)
for m in $OTHER_STABLE_TREES; do
if [ $(git log -F --grep "$subj" --format="%H" $m) ]; then
echo " "$m
fi
done
if [ "$app" = "-" ]; then
echo "Possible dependency chain:"
stable deps $1 10 | sed 's/^/ /'
fi
echo ""
else
printf "[M$app] %s\n" "$(git log -1 --oneline $1)"
if [ "$app" = "-" ]; then
echo "Possible dependency chain:"
stable deps $1 10 | sed 's/^/ /'
echo
fi
fi
}
function handle_nonstable {
others=$(stable find-alts $1)
if [ "$others" != "" ]; then
app=$(applies $1)
printf "[N$app] %s:\n" "$(git log -1 --oneline $1)"
subj=$(git log -1 --pretty="%s" $1)
for m in $OTHER_STABLE_TREES; do
if [ $(git log -F --grep "$subj" --format="%H" $m) ]; then
echo " "$m
fi
done
if [ "$app" = "-" ]; then
echo "Possible dependency chain:"
stable deps $1 10 | sed 's/^/ /'
fi
echo ""
fi
}
function do_one {
if [ "$(git show $1 | grep -i 'stable@vger' | wc -l)" -gt 0 ]; then
handle_stable $1
else
handle_nonstable $1
fi
}
if [ "$#" -ne 1 ]; then
echo "Usage: stable audit-range <commit range>"
exit 1
fi
show_missing_iter $1 do_one