diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-07-06 09:22:35 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-07-06 16:09:40 +0200 |
commit | 8b25d1ad5d2264bdfc2818c7bda74ee2697df6db (patch) | |
tree | 8c3c769777f7e66a2d1ba7dd7651b563cfde370b /scripts/check-git-log.sh | |
parent | 97f17497d162afdb82c8704bf097f0fee3724b2e (diff) |
Imported Upstream version 16.07-rc1
Change-Id: I40a523e52f12e8496fdd69e902824b0226c303de
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'scripts/check-git-log.sh')
-rwxr-xr-x | scripts/check-git-log.sh | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/scripts/check-git-log.sh b/scripts/check-git-log.sh index ce6c15ea..7d2c7ee8 100755 --- a/scripts/check-git-log.sh +++ b/scripts/check-git-log.sh @@ -55,7 +55,7 @@ tags=$(git log --format='%b' $range | grep -i -e 'by *:' -e 'fix.*:') fixes=$(git log --format='%h %s' $range | grep -i ': *fix' | cut -d' ' -f1) # check headline format (spacing, no punctuation, no code) -bad=$(echo "$headlines" | grep \ +bad=$(echo "$headlines" | grep --color=always \ -e ' ' \ -e '^ ' \ -e ' $' \ @@ -69,7 +69,7 @@ bad=$(echo "$headlines" | grep \ [ -z "$bad" ] || printf "Wrong headline format:\n$bad\n" # check headline label for common typos -bad=$(echo "$headlines" | grep \ +bad=$(echo "$headlines" | grep --color=always \ -e '^example[:/]' \ -e '^apps/' \ -e '^testpmd' \ @@ -79,15 +79,15 @@ bad=$(echo "$headlines" | grep \ [ -z "$bad" ] || printf "Wrong headline label:\n$bad\n" # check headline lowercase for first words -bad=$(echo "$headlines" | grep \ +bad=$(echo "$headlines" | grep --color=always \ -e '^.*[A-Z].*:' \ -e ': *[A-Z]' \ | sed 's,^,\t,') [ -z "$bad" ] || printf "Wrong headline uppercase:\n$bad\n" # check headline uppercase (Rx/Tx, VF, L2, MAC, Linux, ARM...) -bad=$(echo "$headlines" | grep \ - -e 'rx\|tx\|RX\|TX' \ +bad=$(echo "$headlines" | grep -E --color=always \ + -e '\<(rx|tx|RX|TX)\>' \ -e '\<[pv]f\>' \ -e '\<l[234]\>' \ -e ':.*\<dma\>' \ @@ -111,9 +111,15 @@ bad=$(echo "$headlines" | awk 'length>60 {print}' | sed 's,^,\t,') [ -z "$bad" ] || printf "Headline too long:\n$bad\n" # check body lines length (75 max) -bad=$(echo "$bodylines" | awk 'length>75 {print}' | sed 's,^,\t,') +bad=$(echo "$bodylines" | grep -v '^Fixes:' | awk 'length>75 {print}' | sed 's,^,\t,') [ -z "$bad" ] || printf "Line too long:\n$bad\n" +# check starting commit message with "It" +bad=$(echo "$bodylines" | head -n1 | grep -E --color=always \ + -ie '^It ' \ + | sed 's,^,\t,') +[ -z "$bad" ] || printf "Wrong beginning of commit message:\n$bad\n" + # check tags spelling bad=$(echo "$tags" | grep -v '^\(Reported\|Suggested\|Signed-off\|Acked\|Reviewed\|Tested\)-by: [^,]* <.*@.*>$' | @@ -134,7 +140,11 @@ IFS=' fixtags=$(echo "$tags" | grep '^Fixes: ') bad=$(for fixtag in $fixtags ; do hash=$(echo "$fixtag" | sed 's,^Fixes: \([0-9a-f]*\).*,\1,') - good="Fixes: $hash "$(git log --format='("%s")' -1 $hash 2>&-) + if git branch --contains $hash | grep -q '^\*' ; then + good="Fixes: $hash "$(git log --format='("%s")' -1 $hash 2>&-) + else + good="reference not in current branch" + fi printf "$fixtag" | grep -v "^$good$" done | sed 's,^,\t,') [ -z "$bad" ] || printf "Wrong 'Fixes' reference:\n$bad\n" |