From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 220D4A0C45 for ; Wed, 16 Jun 2021 06:03:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 12316410E8; Wed, 16 Jun 2021 06:03:58 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2075.outbound.protection.outlook.com [40.107.237.75]) by mails.dpdk.org (Postfix) with ESMTP id F1059410E2; Wed, 16 Jun 2021 06:03:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=emylm2efTKxQQC/IsJXfg0bJQQqzxbPWvWwPE6obdSF5Oa2J4Ohr+/AFSdVakLetahPdMtK7fqOQbqHpt8u/QHR587yOkpOu+i/ZGoq2zZjGT15cH4/vlIXjNWpmwHeH8gNOCTz9FXvLGVzJT/eIP0xW1XpWelbIhdQMP4HJZiLc3j7UE2RN1CWYfZ6SNYpwhySh9VFz7a0/6ZXzYbGdezWUcVAn/0imYYtV8aUOcQUIEgU8wVy/R9SRD1KIIXMZonNTkzN355iQahMUw5Z4qqaesrC2I3ZbyfRf/gyVppoxE5Cde/cnN32w7Wl0F9eytnRoXwMKdrSnL8pGSrrSAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=shel9u1/flkcQBgb9n/pzoX91lwPgY4azowN3my/nPM=; b=Es4xWNLscE1Ww+b5el2tw7Dk4pS5jTJYtSK8SOhEQxVXWPg+eekLQjUxrbK30byIAPBPApP4pEkuwhDB56H1grm5tTGTBCvgNh44bRLyz3PFAJQ6HHU4cVKacZBTLUIbkyCv9ysSlMLw3tt4pWb5PZwShOYKcEvR/mq5veDbXUiiKUAtFUxSx0iv81S/+RdIiyUtpSxBzyYGChFhG2gJEctlJmjp1mgXtAEy12CEZHQvvp+5AkHMfKjqkB11/TEPHOXkS9pN2UTzQullF3TqkbiMn72kBKNwnfezJQTEMy8qWoBDNYu6buayDP4hDuQ5BjnzIfIRUkIzMWHzDvHpoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=shel9u1/flkcQBgb9n/pzoX91lwPgY4azowN3my/nPM=; b=Tnx4Gz3QZdde00lxQA6mY8/XZZLofWzf57NxZoAEt9GCO1+EKZzIYdN6ucVE9jntq+dd+Z8HTa8oMD9QBtEo0Rcd6cYd71dLc/34Lyj4/SEnLZ5IHUgWVi1WqTIttHrsHLKLA0bcHLe0pW1u4zSAO06RPJttdEQPNBmpM/lbAE1hq636SsckUo71R3NARafQvLthbFMhACst1oGFFYLvM3+4qjGMlCmCkyDM1b6jxeQRDrgaRsWSqFTps7qvjRXuZUACbgqp5RRdSGFujx062UfpJwRQ5vwErHc2UV5P5s0NUp3rg9jTAYFLvzo0Hs62Hb7eJkzsEOF3tnSYLmbw/g== Received: from DM5PR13CA0016.namprd13.prod.outlook.com (2603:10b6:3:23::26) by BYAPR12MB2758.namprd12.prod.outlook.com (2603:10b6:a03:6f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Wed, 16 Jun 2021 04:03:53 +0000 Received: from DM6NAM11FT060.eop-nam11.prod.protection.outlook.com (2603:10b6:3:23:cafe::bc) by DM5PR13CA0016.outlook.office365.com (2603:10b6:3:23::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.9 via Frontend Transport; Wed, 16 Jun 2021 04:03:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT060.mail.protection.outlook.com (10.13.173.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4242.16 via Frontend Transport; Wed, 16 Jun 2021 04:03:53 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 16 Jun 2021 04:03:51 +0000 From: Xueming Li To: Christian Ehrhardt , Luca Boccassi CC: , , Thomas Monjalon , , Yuanhan Liu Date: Wed, 16 Jun 2021 07:03:22 +0300 Message-ID: <20210616040324.311461-2-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210612135628.20460-1-xuemingl@nvidia.com> References: <20210612135628.20460-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 842aeffc-1772-4b4d-52c3-08d9307bc183 X-MS-TrafficTypeDiagnostic: BYAPR12MB2758: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:57; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zcMbtlu02U5bGtQvtkoPucbvfudUUGeRRCCAd7S+5ZqSHOU7XoFoNL1ijQ61jIftv8sE202oTMEWZ1DARA4qFdFyiFIKPqk9w5l3RZc6+M5Wc7Is0+DfMi5B9KcGMXYcc879Eh+KfMqT6GXZzWGlAfX2AcpQdvn8xc04nCyyJj8sNCU1iCXPd8sSt+tAz5ppUxVBy3D0xTYWmXH/tK7oHmm1mTmXGqjQYZOjYemcrAusd16SUQnysahQQx0b7dh2xj15tDm/ACTspqCBTUxqXB8Tke5rq3XyzB4/vLf223dUwQEzhXveCa3d7rJpTJvBhg68l1+b8U/ztO5nKsnTOpkIVyMrTt8kfUJSy1dgL+xRfb85qkQPehv64Zr0HlncCPG8N6GQ/gDOuk9tA48SWVxEMPLv/mDW8uz+Z3Zkvg6cLp6375sXyrXw687KGICvISUQvwynLMQW05AJhTwIY0kcHxAmx+Yjn82hi5h5huwHEPOPMHpWG4uaDXt0LWropkI5YHwixJaaxuKy4u9oIQXJ6p1Cf0d1LjBgAqcEHeV9nqsmMfOnbaYhAVaXL2ji699gdD4MFuRGLwPbfCQ/V4bBChOuJ4PBON8XDw7/LxCMEN0PlHaqQH9Ojt+stywuUyrm5wwfNYustcKbBMkG9gGmvnBsCRiXzQ8w2asNJWI= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(396003)(376002)(39860400002)(136003)(346002)(36840700001)(46966006)(316002)(86362001)(36756003)(7696005)(478600001)(54906003)(356005)(8936002)(8676002)(83380400001)(110136005)(82740400003)(336012)(36860700001)(70586007)(70206006)(426003)(82310400003)(6666004)(6286002)(7636003)(47076005)(4326008)(2906002)(16526019)(5660300002)(55016002)(2616005)(186003)(26005)(36906005)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2021 04:03:53.4336 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 842aeffc-1772-4b4d-52c3-08d9307bc183 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT060.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2758 Subject: [dpdk-stable] [PATCH v1 2/2] devtools: auto detect branch to search fix patches X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Current fix scan scripts scanned specified range in current(HEAD) branch. When users run it in an earlier branch, few patches were scanned. This patch introduces optional argument, auto detects from range if not provided. Fixes: 752d8e097ec1 ("scripts: show fixes with release version of bug") Cc: Thomas Monjalon Cc: stable@dpdk.org Signed-off-by: Xueming Li --- devtools/check-git-log.sh | 2 +- devtools/git-log-fixes.sh | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh index 9988bf863d..b463110a90 100755 --- a/devtools/check-git-log.sh +++ b/devtools/check-git-log.sh @@ -51,7 +51,7 @@ 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) +stablefixes=$($selfdir/git-log-fixes.sh $range HEAD | 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:' diff --git a/devtools/git-log-fixes.sh b/devtools/git-log-fixes.sh index 5fc57da913..9d2d0ef96c 100755 --- a/devtools/git-log-fixes.sh +++ b/devtools/git-log-fixes.sh @@ -4,7 +4,7 @@ print_usage () { - echo "usage: $(basename $0) [-h] " + echo "usage: $(basename $0) [-h] [branch]" } print_help () @@ -15,6 +15,7 @@ print_help () Find fixes to backport on previous versions. It looks for the word "fix" in the headline or a tag "Fixes" or "Reverts". The oldest bug origin is printed as well as partially fixed versions. + It looks into the branch specified, otherwise any branch contains the range. END_OF_HELP } @@ -33,14 +34,23 @@ while getopts h ARG ; do done shift $(($OPTIND - 1)) [ $# -ge 1 ] || usage_error 'range argument required' -range="$*" +range="$1" +branch="$2" + +if [ -z "$branch" ] ; then + # last commit in range + range_last=$(git log --oneline v21.05-rc3..v21.05 |head -n1|cut -d' ' -f1) + # use first branch contains the commit + refbranch=$(git branch --contains $range_last -r --sort=-authordate |head -n1) +else + refbranch=$(git rev-parse --abbrev-ref $branch) +fi # get major release version of a commit commit_version () # { local VER="v*.*" # use current branch as history reference - local refbranch=$(git rev-parse --abbrev-ref HEAD) local tag=$( (git tag -l $VER --contains $1 --sort=creatordate --merged $refbranch 2>&- || # tag --merged option has been introduced in git 2.7.0 # below is a fallback in case of old git version @@ -49,9 +59,11 @@ commit_version () # sed "s,.\+,$t," done) | head -n1) - if [ -z "$tag" ] ; then - # before -rc1 tag of release in progress - cat VERSION | cut -d'.' -f-2 + if [ -z "$tag" ]; then + if [ "$branch" = 'HEAD' ]; then + # before -rc1 tag of release in progress + cat VERSION | cut -d'.' -f-2 + fi else echo $tag | sed 's,^v,,' | sed 's,-rc.*,,' fi -- 2.25.1