Currently we match on:
- any arbitrary length of,
- any a-z A-Z and 0-9 characters
At the same time, a commit sha consists of lowercase hexadecimal
numbers. Any sha shorter than 8 characters is ambiguous - in some cases
even 11+ are required.
So change the pattern to a-f0-9 and adjust the length to 8-40.
As we're here we could use a single grep, instead of the grep/sed combo.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
{
fixes=`git show --pretty=medium -s $1 | tr -d "\n" | \
sed -e 's/fixes:[[:space:]]*/\nfixes:/Ig' | \
- grep "fixes:" | sed -e 's/\(fixes:[a-zA-Z0-9]*\).*$/\1/'`
+ grep -Eo 'fixes:[a-f0-9]{8,40}'`
fixes_count=`echo "$fixes" | wc -l`
if [ $fixes_count -eq 0 ] ; then