All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: dev@dpdk.org
Subject: [PATCH v2] scripts: check cc stable mailing list in commit
Date: Thu,  1 Dec 2016 14:43:38 +0100	[thread overview]
Message-ID: <1480599818-14911-1-git-send-email-thomas.monjalon@6wind.com> (raw)
In-Reply-To: <1479768194-6255-1-git-send-email-thomas.monjalon@6wind.com>

Add a check for commits fixing a released bug.
Such commits are found thanks to scripts/git-log-fixes.sh.
They must be sent CC: stable@dpdk.org.
In order to avoid forgetting CC, this mail header can be written
in the git commit message.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
v2: fix option -N
---
 scripts/check-git-log.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/scripts/check-git-log.sh b/scripts/check-git-log.sh
index 5f8a9fc..f79f0a2 100755
--- a/scripts/check-git-log.sh
+++ b/scripts/check-git-log.sh
@@ -47,12 +47,18 @@ if [ "$1" = '-h' -o "$1" = '--help' ] ; then
 	exit
 fi
 
+selfdir=$(dirname $(readlink -e $0))
 range=${1:-origin/master..}
+# convert -N to HEAD~N.. in order to comply with git-log-fixes.sh getopts
+if printf -- $range | grep -q '^-[0-9]\+' ; then
+	range="HEAD$(printf -- $range | sed 's,^-,~,').."
+fi
 
 commits=$(git log --format='%h' --reverse $range)
 headlines=$(git log --format='%s' --reverse $range)
 bodylines=$(git log --format='%b' --reverse $range)
 fixes=$(git log --format='%h %s' --reverse $range | grep -i ': *fix' | cut -d' ' -f1)
+stablefixes=$($selfdir/git-log-fixes.sh $range | sed '/(N\/A)$/d'  | cut -d' ' -f2)
 tags=$(git log --format='%b' --reverse $range | grep -i -e 'by *:' -e 'fix.*:')
 bytag='\(Reported\|Suggested\|Signed-off\|Acked\|Reviewed\|Tested\)-by:'
 
@@ -191,3 +197,10 @@ bad=$(for fixtag in $fixtags ; do
 	printf "$fixtag" | grep -v "^$good$"
 done | sed 's,^,\t,')
 [ -z "$bad" ] || printf "Wrong 'Fixes' reference:\n$bad\n"
+
+# check CC:stable for fixes
+bad=$(for fix in $stablefixes ; do
+	git log --format='%b' -1 $fix | grep -qi '^CC: *stable@dpdk.org' ||
+		git log --format='\t%s' -1 $fix
+done)
+[ -z "$bad" ] || printf "Should CC: stable@dpdk.org\n$bad\n"
-- 
2.7.0

  parent reply	other threads:[~2016-12-01 13:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21 22:43 [PATCH] scripts: check cc stable mailing list in commit Thomas Monjalon
2016-11-30 14:54 ` Ferruh Yigit
2016-11-30 15:09   ` Thomas Monjalon
2016-11-30 15:26     ` Bruce Richardson
2016-11-30 15:31       ` Thomas Monjalon
2016-11-30 15:36         ` Bruce Richardson
2017-01-16  9:51   ` Yuanhan Liu
2017-01-16 10:37     ` Thomas Monjalon
2017-01-16 11:19       ` Yuanhan Liu
2017-01-16 14:26         ` Thomas Monjalon
2017-01-16 14:46           ` Yuanhan Liu
2017-01-16 10:38     ` Ferruh Yigit
2017-01-16 10:54       ` Yuanhan Liu
2016-12-01 13:43 ` Thomas Monjalon [this message]
2016-12-01 15:00   ` [PATCH v2] " Ferruh Yigit
2016-12-01 15:03     ` 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=1480599818-14911-1-git-send-email-thomas.monjalon@6wind.com \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.