From patchwork Fri May 1 11:00:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2260 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1777633311; bh=YV6IJ5/Yw6ZjejGf6zH7H4SdQqeFDc8Vwieg/UtE0pQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cs8ffZ75f4BS4lgOmVU93GZ/PzvCF/Er700rJYkNiPJhC7J0/4EWwqE/mZZh1wyoA tYn0lZ8PbFoFd1g917+0xMKNahc279CarPA325IV1aX2cwIxbEWFwBBhecohDxTZcD zhxrC820/3TREJYq/0z4ZBJjaaE6ErYnPxDTpLgs= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C8CD86A836 for ; Fri, 1 May 2026 05:01:51 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id t1gvJlNh9yHU for ; Fri, 1 May 2026 05:01:51 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1777633311; bh=YV6IJ5/Yw6ZjejGf6zH7H4SdQqeFDc8Vwieg/UtE0pQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cs8ffZ75f4BS4lgOmVU93GZ/PzvCF/Er700rJYkNiPJhC7J0/4EWwqE/mZZh1wyoA tYn0lZ8PbFoFd1g917+0xMKNahc279CarPA325IV1aX2cwIxbEWFwBBhecohDxTZcD zhxrC820/3TREJYq/0z4ZBJjaaE6ErYnPxDTpLgs= Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B083A6A833 for ; Fri, 1 May 2026 05:01:51 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1777633308; bh=ceHfWaTPmi127ryxUJ+XtJor4b2auvbwmMKxV8k4Qy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EvpqaFpR1/aOz/6eDo11b2MubAJ+kV3870aTyhr6qgs40QIyKiOySYs0pzDA4BKae SrGDSQkas9Ug9nlRAXn9R7tlVeYwws7UtIEY6eIHei1QZ6rhzOPs540X69BDAFMID7 VVhYUP9bwaihDIqEL5bo0wPCO/SQpjpMAbHyX4KU= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 544666A840; Fri, 1 May 2026 05:01:48 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id A1l3cPAs_-Cx; Fri, 1 May 2026 05:01:48 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1777633306; bh=PN44c0ZnSYDMHQLPVcHULbEExNdmrPeRkehU+PUl2sw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BVY4U8SkJcgZ0cSTejYcc0ssobLODaTWO0Imhjr4BBOTczP3o9sGR8aoTvfv2IDTA PhBu5qVsJMmzCAnSpg63qYJzP8/63chLBQInk5XPjxQ/6nR5F78i+nIAftDX7Y/1fE m+2isJfuWOCXazXwyCCvEy/za/UzyZUC/akJEhQI= Received: from u-boot.org (unknown [174.51.25.52]) by mail.u-boot.org (Postfix) with ESMTPSA id C383A6A833; Fri, 1 May 2026 05:01:45 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 1 May 2026 05:00:09 -0600 Message-ID: <20260501110040.1874719-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501110040.1874719-1-sjg@u-boot.org> References: <20260501110040.1874719-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7TS3G25JBLLOPYFHEXTRYJ7RPZQW5U75 X-Message-ID-Hash: 7TS3G25JBLLOPYFHEXTRYJ7RPZQW5U75 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 17/29] patman: Abort review on partial or interrupted apply List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When the apply agent finishes successfully but only some of the patches actually land on the review branch, the subsequent review runs against an incomplete series and produces confusing output: the cover letter claims N patches but only M commits exist. Compare the applied count from gitutil.count_revs() against patch_count and abort with a clear message when they differ, asking the user to resolve the conflicts manually and retry. The 'no commits' case (None from count_revs(), or zero) already routes through the existing failure path that rolls back the database and restores the original branch. Signed-off-by: Simon Glass --- tools/patman/review.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/patman/review.py b/tools/patman/review.py index 66580e48ee6..8af13b65711 100644 --- a/tools/patman/review.py +++ b/tools/patman/review.py @@ -1632,6 +1632,12 @@ def _apply_and_check(ctx, link): applied = gitutil.count_revs( repo_path, f'{ctx.upstream_branch}..{branch_name}') if not applied: + # Zero commits, or branch missing because apply was interrupted + success = False + elif applied != ctx.patch_count: + tout.error(f'Only {applied} of {ctx.patch_count} patches ' + f'applied to {branch_name}; aborting. Fix the ' + 'conflicts manually and retry.') success = False if not success: