From patchwork Tue Apr 18 14:07:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 126242 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 367D84297D; Tue, 18 Apr 2023 16:08:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0EE0342D16; Tue, 18 Apr 2023 16:08:05 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 0212B42C24 for ; Tue, 18 Apr 2023 16:08:03 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 99B605C0117; Tue, 18 Apr 2023 10:08:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 18 Apr 2023 10:08:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1681826882; x= 1681913282; bh=QgyJDe8EooEBkNT0KoTdr/uL/Aqgis/rSb4DgLmmtx4=; b=s hu+Ephg/00ycs3ySg1QN8sggE1gKKLN0k25NvGLQaKCZ23WrUPfhIOK9KBqp4zSN PlZiK4J+d6H9it8tgVaMCM6gwDtN5mxOX4m/XQ7xq68dN52EJAnB55Ei3NFFyrlf /fAIFNWR2M0f3hQwNkPoi4rvsAyKxA8AMSA/PCWhvl+IfiEjgiqHbFSGvX2MN4qD nKX0na5GXqK8eeITVBHX2NVRtSo6CLayoFZiSY5xjO+Qjhb88LUzn3H41Dj2aKVw o3sxR5ZKY2ulILF+6OjcDQdShyQ7Uvh4oPHkLhLcnIjHYWLo8wm4ZvQTyjdbZl/1 jK81Z3zq8pwMWCVWvRc8Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1681826882; x=1681913282; bh=Q gyJDe8EooEBkNT0KoTdr/uL/Aqgis/rSb4DgLmmtx4=; b=j6dU+LxaPzdF/1FCj zrFNaqcvXijfPj0mfO3bzxr1wEhgw5PoUzcCIFc1oXRThRLWSej+aWUXh3wR/o2O mT70NwVgdSbaA8VZbBXg5v8jJ7bGNHo8yBPbvIcMlBMofDK4m1PriVcrbrTZVJ7q IC9n4RfyNyocgM4gPGrGU0B3XisBqjtcqFisaFCLwinxPSfILl2X/yVJpbic7oRG +LkvjDfpPMxpX5nWSVQ2lZWSlmdn/LABPtWOI5x7XfYh8edbc8QJ2MPQJ0fkz1bS K+zUaCuUmxZHGwxstz8kpvnLg2Znt7dgtcq63otAWp0KFf26AJ96nwcYcZqgISkz r7KAw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdelkedgjedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes mhhonhhjrghlohhnrdhnvghtqeenucggtffrrghtthgvrhhnpedvhefgiedvjeegtdevhe efhfetleefgfeivefgffevfeejgedtgfeutdehtdegveenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrd hnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 18 Apr 2023 10:08:02 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Subject: [PATCH 2/2] devtools: deduplicate function to mark fixes Date: Tue, 18 Apr 2023 16:07:26 +0200 Message-Id: <20230418140726.1472209-3-thomas@monjalon.net> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230418140726.1472209-1-thomas@monjalon.net> References: <20230418140726.1472209-1-thomas@monjalon.net> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org In the commit 8070d8fecb4e ("devtools: add fixes flag to commit listing") the function to mark a commit for "stable" was duplicated for "Fixes:" mark. The code is a bit smaller by using a single function for both marks. Signed-off-by: Thomas Monjalon Acked-by: Luca Boccassi --- devtools/git-log-fixes.sh | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/devtools/git-log-fixes.sh b/devtools/git-log-fixes.sh index 4690dd4545..005e46f715 100755 --- a/devtools/git-log-fixes.sh +++ b/devtools/git-log-fixes.sh @@ -84,31 +84,21 @@ origin_version () # ... done | sort -uV | head -n1 } -# print a marker for stable tag presence -stable_tag () # +# print a marker for pattern presence in the commit message +git_log_mark () # { - if git log --format='%b' -1 $1 | grep -qi '^Cc: *stable@dpdk.org' ; then - echo 'S' + if git log --format='%b' -1 $1 | grep -qi "$2" ; then + echo "$3" else echo '-' fi } -# print a marker for fixes tag presence -fixes_tag () # -{ - if git log --format='%b' -1 $1 | grep -qi '^Fixes: *' ; then - echo 'F' - else - echo '-' - fi -} - git log --oneline --reverse $range | while read id headline ; do origins=$(origin_filter $id) - stable=$(stable_tag $id) - fixes=$(fixes_tag $id) + stable=$(git_log_mark $id '^Cc: *stable@dpdk.org' 'S') + fixes=$(git_log_mark $id '^Fixes:' 'F') [ "$stable" = "S" ] || [ "$fixes" = "F" ] || [ -n "$origins" ] || continue version=$(commit_version $id) if [ -n "$origins" ] ; then