#!/bin/bash
# check-patch-blacklist blacklist patch-filename < patch-content
test -f "$1" || exit 0
hash=$(grep -Ei "^Git-commit:[ \t]+[a-f0-9]{40}\>")
if [ -n "$hash" ] ; then
hash=$(echo "${hash#*: }" | head -c 40)
blacklist=$(grep -Ei "^$hash\>" < "$1")
if [ -n "$blacklist" ]; then
echo "Patch $2
blacklisted: $blacklist
Please remove from blacklist if you really think this patch should be included."
exit 1
fi
fi