DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>, david.marchand@redhat.com
Subject: Re: [dpdk-dev] [PATCH] devtools: check commit log fixes syntax
Date: Tue, 29 Jan 2019 21:41:42 +0100	[thread overview]
Message-ID: <6678803.r9xRYSV9tQ@xps> (raw)
In-Reply-To: <20190129153052.38634-1-ferruh.yigit@intel.com>

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

  parent reply	other threads:[~2019-01-29 20:41 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
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 [this message]
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=6678803.r9xRYSV9tQ@xps \
    --to=thomas@monjalon.net \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=qi.z.zhang@intel.com \
    /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).