From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH] devtools: make commits with stable tag outstanding Date: Thu, 6 Apr 2017 14:31:55 +0800 Message-ID: <20170406063155.GR18844@yliu-dev.sh.intel.com> References: <1487818172-12910-1-git-send-email-yuanhan.liu@linux.intel.com> <5048683.EcVWt1ukKe@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Thomas Monjalon Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 130131DB1 for ; Thu, 6 Apr 2017 08:34:31 +0200 (CEST) Content-Disposition: inline In-Reply-To: <5048683.EcVWt1ukKe@xps13> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Mar 10, 2017 at 12:13:28PM +0100, Thomas Monjalon wrote: > 2017-02-23 10:49, Yuanhan Liu: > > So that, as a stable maintainer while picking commits to a stable release, > > I could pay less attention to those have it and pay more attention to those > > don't have it. > > Good idea > > > + stable="-" > > + git show $id | grep -qi 'Cc: .*stable@dpdk.org' && stable="S" > > Instead of git show, it is preferrable to get only the message content: > git log --format='%b' -1 $id > > The regex may miss a Cc: without space, and may match a Cc in the middle > of a sentence. > I suggest this one: > grep -qi '^Cc: *stable@dpdk.org' > > The script is written in the style "set -e" so it must be avoided to have > a "false" statement not catched. > It can be done in 2 ways: > > 1/ > git log --format='%b' -1 $id | grep -qi '^Cc: *stable@dpdk.org' && stable='S' || stable='-' > > 2/ > if git log --format='%b' -1 $id | grep -qi '^Cc: *stable@dpdk.org' ; then > stable='S' > else > stable='-' > endif > > We can also move it in a function in order to keep only the logic in the > "main" block: > stable=$(stable_tag $id) Looks good. Will send v2 soon. Thanks. --yliu > > # print a marker for stable tag presence > stable_tag () # > { > if git log --format='%b' -1 $id | grep -qi '^Cc: *stable@dpdk.org' ; then > echo 'S' > else > echo '-' > endif > }