From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-f196.google.com (mail-vk1-f196.google.com [209.85.221.196]) by dpdk.org (Postfix) with ESMTP id BBA1E1B1FF for ; Wed, 30 Jan 2019 10:58:12 +0100 (CET) Received: by mail-vk1-f196.google.com with SMTP id y14so5206954vky.9 for ; Wed, 30 Jan 2019 01:58:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ip16gZ4hQ6Ak59Vn7haic7L3AmP0LfFO6txo50QB9ho=; b=pvgmjvohop+K+Bo3PwP/er6uqmCPOMHzbmh3Jh8RyID3sfcBDnXaFVfeMG5r0hSOAx qkd7FdGa2edujxwy1UomFZmH7sEMSBCFhwXcS3WNsX8V69m4SJvHEHgWPHWf/d0RD86f GriXJ8UibRBEgCquAMp3LILhoRb6uEjTkyX5Js8BnZpIv0dyvKRe5VdDuAo21yT7pqlG sXMfg41sc6V3MkX4QJ0vNmIZEmWQhFWk6p7iYEk4aXIuzl1fYpyBALeBZZsi949DvRgy mj43wB0IQdDlFlfSOLjYotPjwbL24W0K+WNXjlvFn7plEvTcfvfV5GSaouVBw9pEfKhq WJIQ== X-Gm-Message-State: AJcUukdx8Eu+PpAfR8YdUx4zZjrePLtgqJNmWk2wCgeo1VPDmkH+1D3f FE7yiGVhJz0j5hk3XcDhTlR+FU0szY69YJZcqbvABQ== X-Google-Smtp-Source: ALg8bN5o/OyLEZilqNSlhkic3OuEUEt97IprhWpA1W2VSytpUVboNZ3UfuuAR9quV1ZYVjOLA2koqrF3utLQV/9c4ow= X-Received: by 2002:a1f:b58d:: with SMTP id e135mr12210483vkf.86.1548842292011; Wed, 30 Jan 2019 01:58:12 -0800 (PST) MIME-Version: 1.0 References: <20190129153052.38634-1-ferruh.yigit@intel.com> <6dfa0d84-3734-51be-a4a2-298c0f1b9b7c@intel.com> In-Reply-To: <6dfa0d84-3734-51be-a4a2-298c0f1b9b7c@intel.com> From: David Marchand Date: Wed, 30 Jan 2019 10:58:00 +0100 Message-ID: To: Ferruh Yigit Cc: Thomas Monjalon , dev@dpdk.org, Qi Zhang Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] devtools: check commit log fixes syntax X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2019 09:58:12 -0000 On Tue, Jan 29, 2019 at 7:07 PM Ferruh Yigit wrote: > On 1/29/2019 5:34 PM, David Marchand wrote: > > On Tue, Jan 29, 2019 at 4:31 PM Ferruh Yigit > wrote: > > > >> 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. > >> > > > > Can't git decide to report a longer string in case of collisions of > > abbreviated id ? > > > > Tried this for 2 characters, and git forcefully reported 5 chars: > > $ git log -1 --abbrev=2 origin/master --format='Fixes: %h (\"%s\")' > > Fixes: a2f9c (\"version: 19.02-rc4\") > > > > I did not find any collisions with 12 characters abbreviated commitid, > but > > I am not sure enforcing the check on exactly 12 characters is a good idea > > in the long run. > > Yes git can report a longer string in case of collisions, but I don't > expect to > have one with 12 characters. > > This is mainly for some cases either people use full 40 chars or small > ones. > > Indeed in background I am (and most probably Thomas too) fixing them while > merging, I thought it is better idea to integrate that into script so that > developers can be aware of the syntax issue and fix it before sending. > I can understand you want to avoid such edits yes, and so this patch. However, I think we can do one more thing. The contributing guide does indicate you are supposed to run both checkpatches.sh and check-git-log.sh. I am pretty sure I missed this second step in the past.. How about calling check-git-log.sh from checkpatches.sh ? check-git-log.sh does not support patch files as input, so it would need support for it. > > > > > >> Signed-off-by: Ferruh Yigit > >> --- > >> Cc: Qi Zhang > >> --- > >> devtools/check-git-log.sh | 5 +++++ > >> 1 file changed, 5 insertions(+) > >> > >> diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh > >> index d39064f9d..f4d6c1fba 100755 > >> --- 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) > >> > > > > Not an awk expert (this could be done in pure shell, but this is a > > different story :-p), but I would see something like: > > > > for fixtag in $fixtags; do > > echo $fixtag | awk 'length($2) < 12 { print $2 }'; > > done > > Yes, looks better, I will update the script. > > And no specific preference on shell or awk implementation, there is no > performance concern in this script and awk already used by it, I am good > as long > as it is functional. > Well, I've seen Thomas reply, looks even better ;-). -- David Marchand