From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-f66.google.com (mail-vs1-f66.google.com [209.85.217.66]) by dpdk.org (Postfix) with ESMTP id 59DDB1B142 for ; Tue, 29 Jan 2019 18:34:19 +0100 (CET) Received: by mail-vs1-f66.google.com with SMTP id y27so12477995vsi.1 for ; Tue, 29 Jan 2019 09:34:18 -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=i2Zpa4wBajCsKYdiADL0lQpTf3kC8KKc5xpl/ueTNOM=; b=ksZBB7k3BCU08svXFRh6JXAtXFIgIS7HG7/+FFRCRy511ofjm0mJQnKPjDwva0cUHd rsX70o+BOin9BwCqWbxQAAtR3fvSzwHf16tqatSta+FuJ4R5IND2sqrAU8D1BxxulTqz dnq3nczwIfnDMrZGuntGiBZ4mHwj1pAeFGVhT+xreY74B61eAsJYlEHazo12YwV8i3kx JPOJzQ1lXMOuVWCa6fFkY3rjafuyztgu38md6KJuE+poWyIAV0DWf13M34yhRDbj7Ny0 AbJD8SwklsVn93x7+cdWWhQ+OUJLVYJS4pea0EQ8/t09Qfw5v4XDMHl2vXBJJ/kc3ai+ C9yw== X-Gm-Message-State: AJcUukcPBl5rHih0v/LXuKlSGh3GP4Ht1muG13VefWIsfy0g9JYom1Yd 6XUSW1ITJwxDOmx6gTeR4BqYVg3rGJUiIMDeA+QyYQ== X-Google-Smtp-Source: ALg8bN4DwW3qNFhIA7NLCzlCoGnHvMXgO9EndS4Vq5j8AVWlaTbMjBGDBEytmIpt1smOrfPd5DMJv8ENYJFWxAV70lk= X-Received: by 2002:a67:3cd6:: with SMTP id w83mr11380279vsh.39.1548783258277; Tue, 29 Jan 2019 09:34:18 -0800 (PST) MIME-Version: 1.0 References: <20190129153052.38634-1-ferruh.yigit@intel.com> In-Reply-To: <20190129153052.38634-1-ferruh.yigit@intel.com> From: David Marchand Date: Tue, 29 Jan 2019 18:34:07 +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: Tue, 29 Jan 2019 17:34:19 -0000 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. > 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 -- David Marchand