From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] devtools: check commit log fixes syntax Date: Wed, 30 Jan 2019 11:15:44 +0000 Message-ID: References: <20190129153052.38634-1-ferruh.yigit@intel.com> <6678803.r9xRYSV9tQ@xps> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, Qi Zhang , david.marchand@redhat.com To: Thomas Monjalon Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 40DEA1B1FF for ; Wed, 30 Jan 2019 12:15:48 +0100 (CET) In-Reply-To: <6678803.r9xRYSV9tQ@xps> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 1/29/2019 8:41 PM, Thomas Monjalon wrote: > 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. That is OK, if we don't want to be strict on this, I will update patch as rejected. > >> --- 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 > > >