From: Nelio Laranjeiro Date: Wed, 29 Jun 2016 15:55:08 +0000 (+0200) Subject: scripts: check headline of drivers commits X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e757070d64ff0531f89f311de4b2bbd3f8251f3f;p=dpdk.git scripts: check headline of drivers commits A driver patch under net should start with "net/" or if a patch touch multiple drivers, it should only start with "net:". The same apply for crypto. A patch touching all drivers (net + crypto) should start with "drivers:". Longer prefixes like "net/mlx:" (for mlx4/mlx5) or "net/e1000/base:" are handled by not checking the colon. The directories doc/ and config/ are ignored because a driver patch can modify them. Signed-off-by: Nelio Laranjeiro Signed-off-by: Thomas Monjalon --- diff --git a/scripts/check-git-log.sh b/scripts/check-git-log.sh index 035acf688b..8a7ddbd7ca 100755 --- a/scripts/check-git-log.sh +++ b/scripts/check-git-log.sh @@ -70,6 +70,24 @@ bad=$(echo "$headlines" | grep --color=always \ | sed 's,^,\t,') [ -z "$bad" ] || printf "Wrong headline format:\n$bad\n" +# check headline prefix when touching only drivers, e.g. net/ +bad=$(for commit in $commits ; do + headline=$(git log --format='%s' -1 $commit) + files=$(git diff-tree --no-commit-id --name-only -r $commit) + [ -z "$(echo "$files" | grep -v '^\(drivers\|doc\|config\)/')" ] || + continue + drv=$(echo "$files" | grep '^drivers/' | cut -d "/" -f 2,3 | sort -u) + drvgrp=$(echo "$drv" | cut -d "/" -f 1 | uniq) + if [ $(echo "$drvgrp" | wc -l) -gt 1 ] ; then + echo "$headline" | grep -v '^drivers:' + elif [ $(echo "$drv" | wc -l) -gt 1 ] ; then + echo "$headline" | grep -v "^$drvgrp" + else + echo "$headline" | grep -v "^$drv" + fi +done | sed 's,^,\t,') +[ -z "$bad" ] || printf "Wrong headline prefix:\n$bad\n" + # check headline label for common typos bad=$(echo "$headlines" | grep --color=always \ -e '^example[:/]' \