From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] devtools: check commit log fixes syntax Date: Tue, 29 Jan 2019 21:41:42 +0100 Message-ID: <6678803.r9xRYSV9tQ@xps> References: <20190129153052.38634-1-ferruh.yigit@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Qi Zhang , david.marchand@redhat.com To: Ferruh Yigit Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id AAAAD1B142 for ; Tue, 29 Jan 2019 21:41:46 +0100 (CET) In-Reply-To: <20190129153052.38634-1-ferruh.yigit@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 29/01/2019 16:30, Ferruh Yigit: > Fixes line commit id length defined as 12 in fixline alias: > fixline = log -1 --abbrev=12 --format='Fixes: %h (\"%s\")%nCc: %ae' > > Check if the Fixes line commit id length matches the defined value. This check was missing on purpose, in order to not be too strict. I think it's OK if the length of the SHA1 is not always the same. > --- a/devtools/check-git-log.sh > +++ b/devtools/check-git-log.sh > @@ -177,6 +177,11 @@ bad=$(for fixtag in $fixtags ; do > done | sed 's,^,\t,') > [ -z "$bad" ] || printf "Wrong 'Fixes' reference:\n$bad\n" > > +bad=$(for fixtag in $fixtags ; do > + echo $fixtag | awk '{print $2}' | awk 'length != 12 {print}' > +done) > +[ -z "$bad" ] || printf "Wrong 'Fixes' syntax:\n$bad\n" > + > # check Cc: stable@dpdk.org for fixes > bad=$(for fix in $stablefixes ; do > git log --format='%b' -1 $fix | grep -qi '^Cc: *stable@dpdk.org' || If you really want to be that strict, it can be done simpler: bad=$(for fixtag in $fixtags ; do hash=$(echo "$fixtag" | sed 's,^Fixes: \([0-9a-f]*\).*,\1,') if git branch --contains $hash 2>&- | grep -q '^\*' ; then - good="Fixes: $hash "$(git log --format='("%s")' -1 $hash 2>&-) + good=$(git log --abbrev=12 --format='Fixes: %h ("%s")' -1 $hash 2>&-) else good="reference not in current branch" fi