From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) by dpdk.org (Postfix) with ESMTP id 5B5DF2C49 for ; Fri, 10 Mar 2017 12:13:30 +0100 (CET) Received: by mail-wr0-f179.google.com with SMTP id l37so62790740wrc.1 for ; Fri, 10 Mar 2017 03:13:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=VWgtRYdS2akWkNyCsLY7xLzo9X9B9qBQV8zMUaZUhaE=; b=hqx71gY8uyTTCYrnpibgEocjb8Foinrw7lVlCWoTAngmC3xZKV43U+1EMBQsc7kHMz +7zBzB02Y6yT4ZcI27dkm+2KLIBF/NDMKyXr5h69byaDblRpfJFltA966/wD4XLq4Jzi Wo0x4mPKdG0k9KlDH1t1G4ASBCxDCrNg51a1AXRrjgnyYz+1bC6PneEXPK9XXYk57YHe x8qa2rIhT8p3fbGxNXrBsuwVTh4EV101jNWRQbypsrIZqrDFuWqZxeUPENmkWAF61d4k nQfTmvJrTqQUADghNVpoY7RoqtX/wAn1MM+4kEaZZUNeUbuZMk4ZfP16nf0srl8EuO6o P/2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=VWgtRYdS2akWkNyCsLY7xLzo9X9B9qBQV8zMUaZUhaE=; b=YhxkVkX75yXCp9aLi6zacR5ySPaYmCh2lDi2ySriR3bLJY3VBtkfhk4TK05R5V4KSl ZEw6SDuQkU1BdeZvpe3I+DnIwdU2erobmAAHin0oMYv8ujaR23F62BHVMgpYl9bNntnl eqcEc21omqwA8PJs0e6ePbnb1jFS0lvbjMAxIKO/YNzdItZzWexDrsT/LKdJouNlNJ0k Yc/pY04sQ2BO7Z5vNa5tWjqfizMG9Gpiqyzps7FKORvlcuOiPw7ogZNCzz2xWr1ocExo KBHybWpesMqYMdxYHTOnCyhWnUZIpe3vSl1uAvC3Ch91hDL69f07Jv4lTgVm4/w4wWsI EDWQ== X-Gm-Message-State: AMke39mTWjtFn7Zb1MlJjPP6xO3LE+OQYuFafn4Gw4NxHa7BiwyWj7h3UkjfvBkfFWlEdH/z X-Received: by 10.223.144.65 with SMTP id h59mr17280185wrh.30.1489144409743; Fri, 10 Mar 2017 03:13:29 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id j26sm12367179wrb.69.2017.03.10.03.13.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Mar 2017 03:13:29 -0800 (PST) From: Thomas Monjalon To: Yuanhan Liu Cc: dev@dpdk.org Date: Fri, 10 Mar 2017 12:13:28 +0100 Message-ID: <5048683.EcVWt1ukKe@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1487818172-12910-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1487818172-12910-1-git-send-email-yuanhan.liu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] devtools: make commits with stable tag outstanding 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: Fri, 10 Mar 2017 11:13:30 -0000 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) # 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 }