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 3CB50A0547; Wed, 11 Aug 2021 13:22:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C8B12411E8; Wed, 11 Aug 2021 13:22:34 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2074.outbound.protection.outlook.com [40.107.212.74]) by mails.dpdk.org (Postfix) with ESMTP id 85C5A411E7; Wed, 11 Aug 2021 13:22:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bvme0h4Qda38JjG0gJLnxzZem33DZPxWCqski+dELoHKj1XrmHLuY9+aAO3Bs0OV3dDnQQr9AmqZHPsrS0brpMxEzX7hWNGuTfFeELUYRusX+R0Qzgg6KPYPCxXZc7INgcgP5aapab35PwxVxC5wRTenTwK54T1aDTRsR6WLF+G2wRO/Pg9PNNIq58QpVYl6NKJrNAx9WtQc+0Ho5KHKbKI+2K5iU5dv8bU/2vIYkvZhZfQkMacsqWpgabhD71KESIbtyuJGgXEOkPIqS3NlmdZWKLdahj3j0T7h5wJibS0MAGKgKNiSqfXiyTBojGyYDsFoTIc/SECH2vJiCpiRag== 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=SzEPiB85EJLYH5MjJeUF0ApMELzz6gqA8UfH+9ysB60=; b=WfDmDmIsuupAvoF7lMlt+v3Bwu0NVVfW7kh8xQlbg7+wBkTnAEDC/hbmIXt5kZY5yIIMY0HaG5YWK16+/90fwzDcb2qOEiofHa/NnyIdXD5Ri72OhSMdqCpSC6durLkrV5Pr1e8IlQDQ+O/VWQPnz0qv648h46kii9j82s3VaZjNk1MT7ZPgsnV2u03xvNw7GDXc2RDgLefcVrbFY0m+FPAluat9H6gItB/VzjTEy+BbfKDNPZVFwmYuXpM0ZBZe2W/MlQAgf+Dep7oQLV5DZSuJakNUwpRA5Y6+LIwYBgc8FUppyBefZRyYyLHAQiy61ibVm4hIUHmIxJC0iSE27A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=canonical.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine 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=SzEPiB85EJLYH5MjJeUF0ApMELzz6gqA8UfH+9ysB60=; b=KpAkuzHjM8ABxjTn1XxTSeusPk8S2M9XEUbUWwlDaaMvULGHEEs91pg1CffYmH5vzhgVx/RTNa6ss9i8vB3kmaadza5M4HiHELj3Ijh7s3yDq2T0xbpc7o1zpJ/LzT5vaHr5mLJ63QyBGZrPFfntW2IKab5YdFCQhUSOlvqUmsJhSabjGQCtmOcEGLV8hlMq3tk++EONn3jn61YAsmZmsLPczGBIaXbXySwR0ITc/cIUZaydzkzj+ImKkDR9Do5Nj7hDM7N+hejeQu6g5YCq7J+Mlx0kd5yEHqGRRoW60qisYetQi4zf3EmpvC6kux5Abi1P+bx2yVhhV5JJEBLg8Q== Received: from MW4P222CA0007.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::12) by DM6PR12MB4418.namprd12.prod.outlook.com (2603:10b6:5:28e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 11:22:32 +0000 Received: from CO1NAM11FT026.eop-nam11.prod.protection.outlook.com (2603:10b6:303:114:cafe::47) by MW4P222CA0007.outlook.office365.com (2603:10b6:303:114::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 11:22:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; canonical.com; dkim=none (message not signed) header.d=none;canonical.com; 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 CO1NAM11FT026.mail.protection.outlook.com (10.13.175.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 11:22:31 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 11 Aug 2021 11:22:27 +0000 From: Xueming Li To: CC: , , Thomas Monjalon , , Christian Ehrhardt , Yuanhan Liu Date: Wed, 11 Aug 2021 14:22:06 +0300 Message-ID: <20210811112207.370348-2-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210811112207.370348-1-xuemingl@nvidia.com> References: <20210612135628.20460-1-xuemingl@nvidia.com> <20210811112207.370348-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5bb0893a-6035-4bf5-215e-08d95cba4fac X-MS-TrafficTypeDiagnostic: DM6PR12MB4418: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:363; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hRRAaejpYXE6SP2nqNTiSqJoCOxHg05CXDASiV8TS/BzrX2J+rslDQOXDEIWp0TLKM/qk8GmHL2HEgROA6ARlYYhzMLD8e4kyvjx31hz22rZ2MwvMTjigQ4q4xPxq4yixJxWF57NChUtsa66rb6mTo8MWaTjMxPAiRjY6vneIX3qZlf42dhIB2TBifguoXFp5D8ax2NI23+7kqCAFyrCpxsW3Bh3XXMkT58w8ED46SCxUKuV4tLp22oKflBssHU0dwkZiWfYBLvxANLlEw6LjKZ7NC1ehVlW9fBjBjIy2Wu5gvZPfpjP+vlDxBWov7bUTT4CbHW64IMjDeD/X4KaYKaeIm0tkopX4ciQOGxCxg8kNSVwrnVZqdIB+33Tm+AbShElngquVfYUN4A9VV9NBSY+3GQcKMqgyxKhy33E+M9WoB1q9ahwvOenB9e1xE9CUsWSNsafk/WM+dzkqwpqcpWF/bSg8uLWfIlCO1jWkIYLIhe5o/RLVLjeF7+5dDSAY4AqLHboNhLZlGszBElQlgLHdZL8wVMA1pbcz7mgv5uP8KuOO/pNTNKPhu5WVDFjpABsZ4gLwlRxlOvtaItL1IODHHcQBe3Sm/RksPB2j13UH/wbV6WzQI52bwPz6hU/v21ewMnEkCLQDi7nggP8jnkNZS7YNM9Vk3cB+sIeIkQxU3OOyQ/4K37MHo6wN6HCpdcwEAo5mHV4eutErAbN21PawQi3YxDg1O0dFnZVAXg= 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)(36840700001)(46966006)(508600001)(8936002)(1076003)(47076005)(4326008)(82310400003)(86362001)(5660300002)(36860700001)(2906002)(109986005)(356005)(336012)(55016002)(26005)(426003)(83380400001)(8676002)(7636003)(186003)(70206006)(70586007)(7696005)(6286002)(2616005)(16526019)(316002)(36756003)(36906005)(6666004)(54906003)(266003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 11:22:31.8989 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5bb0893a-6035-4bf5-215e-08d95cba4fac 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: CO1NAM11FT026.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4418 Subject: [dpdk-dev] [PATCH v3 2/2] devtools: fix patches missing if range newer than HEAD 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 Sender: "dev" Current fix scan scripts used HEAD branch as history reference. When users ran it in an earlier branch, few patches were scanned due to the fixes in the range are newer and not merged to current branch. This patch introduces optional argument, default to HEAD if not specified. Checks the specified in parameter must being merged in . Fixes: 752d8e097ec1 ("scripts: show fixes with release version of bug") Cc: Thomas Monjalon Cc: stable@dpdk.org Cc: Christian Ehrhardt Signed-off-by: Xueming Li --- devtools/git-log-fixes.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/devtools/git-log-fixes.sh b/devtools/git-log-fixes.sh index 153ba5b438..dbed4b6419 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] []" } 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 current branch or the branch specified. 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" + +# default to current branch as history reference +[ -n "$branch" ] || branch="HEAD" +# get real brnach name +refbranch=$(git rev-parse --abbrev-ref $branch) +range_last=$(git rev-parse $range | head -n1) +if ! git branch -a --contains $range_last | grep -q -e " $refbranch$" -e " remotes/$refbranch$"; then + echo "range $range not included by branch $refbranch" + exit 1 +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