From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH] scripts: fix commit check of first word Date: Tue, 5 Jul 2016 17:54:26 +0200 Message-ID: <1467734066-18240-1-git-send-email-thomas.monjalon@6wind.com> Cc: dev@dpdk.org To: bruce.richardson@intel.com Return-path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 3833C684E for ; Tue, 5 Jul 2016 17:54:35 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id a66so158792502wme.0 for ; Tue, 05 Jul 2016 08:54:35 -0700 (PDT) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The first word of each commit message is checked. But when the commit range was greater than 1, only the latest commit was checked. It is fixed by checking each commit separately. Fixes: 9c24780f0d5e ("scripts: check first word of commit messages") Signed-off-by: Thomas Monjalon --- scripts/check-git-log.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/check-git-log.sh b/scripts/check-git-log.sh index 7d2c7ee..c7fc0e4 100755 --- a/scripts/check-git-log.sh +++ b/scripts/check-git-log.sh @@ -49,6 +49,7 @@ fi range=${1:-origin/master..} +commits=$(git log --format='%h' $range) headlines=$(git log --format='%s' $range) bodylines=$(git log --format='%b' $range) tags=$(git log --format='%b' $range | grep -i -e 'by *:' -e 'fix.*:') @@ -115,9 +116,10 @@ bad=$(echo "$bodylines" | grep -v '^Fixes:' | awk 'length>75 {print}' | sed 's,^ [ -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,') +bad=$(for commit in $commits ; do + firstbodyline=$(git log --format='%b' -1 $commit | head -n1) + echo "$firstbodyline" | grep --color=always -ie '^It ' +done | sed 's,^,\t,') [ -z "$bad" ] || printf "Wrong beginning of commit message:\n$bad\n" # check tags spelling -- 2.7.0