From: Ferruh Yigit <ferruh.yigit@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: Thomas Monjalon <thomas@monjalon.net>,
dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>
Subject: Re: [dpdk-dev] [PATCH] devtools: check commit log fixes syntax
Date: Tue, 29 Jan 2019 18:07:51 +0000 [thread overview]
Message-ID: <6dfa0d84-3734-51be-a4a2-298c0f1b9b7c@intel.com> (raw)
In-Reply-To: <CAJFAV8znru5Nu1+GhnPi5uY_-tJZ9RhhRWXsktMirOMSQrDpSA@mail.gmail.com>
On 1/29/2019 5:34 PM, David Marchand wrote:
> On Tue, Jan 29, 2019 at 4:31 PM Ferruh Yigit <ferruh.yigit@intel.com> 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.
>
>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>> Cc: Qi Zhang <qi.z.zhang@intel.com>
>> ---
>> 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.
next prev parent reply other threads:[~2019-01-29 18:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-29 15:30 Ferruh Yigit
2019-01-29 17:34 ` David Marchand
2019-01-29 18:07 ` Ferruh Yigit [this message]
2019-01-30 9:58 ` David Marchand
2019-01-30 11:17 ` Ferruh Yigit
2019-01-30 11:24 ` Bruce Richardson
2019-01-30 11:27 ` Thomas Monjalon
2019-01-30 11:31 ` Bruce Richardson
2019-01-30 12:23 ` Thomas Monjalon
2019-01-29 20:41 ` Thomas Monjalon
2019-01-30 11:15 ` Ferruh Yigit
2019-01-30 11:29 ` Bruce Richardson
2019-01-30 11:31 ` Thomas Monjalon
2019-01-30 11:35 ` Bruce Richardson
2019-01-30 12:22 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6dfa0d84-3734-51be-a4a2-298c0f1b9b7c@intel.com \
--to=ferruh.yigit@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).