From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH] scripts: check fixed commit branch Date: Wed, 29 Jun 2016 16:47:23 +0200 Message-ID: <1467211643-26341-1-git-send-email-thomas.monjalon@6wind.com> To: dev@dpdk.org Return-path: Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 488B42BB9 for ; Wed, 29 Jun 2016 16:47:33 +0200 (CEST) Received: by mail-wm0-f50.google.com with SMTP id r201so77507413wme.1 for ; Wed, 29 Jun 2016 07:47:33 -0700 (PDT) Received: from XPS13.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id g10sm4065881wjl.25.2016.06.29.07.47.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Jun 2016 07:47:31 -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 commit id of a fixed commit must be in the current branch. It avoids referencing a local branch or a next-* branch when pushing in the master. Signed-off-by: Thomas Monjalon --- scripts/check-git-log.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/check-git-log.sh b/scripts/check-git-log.sh index 9a0d068..7d2c7ee 100755 --- a/scripts/check-git-log.sh +++ b/scripts/check-git-log.sh @@ -140,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" -- 2.7.0