From patchwork Thu Feb 12 21:16:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1841 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=1770931014; bh=K4MzQprB9OXsZy00XyS4I/E1tzShsLiHl/uOn0wLF7M=; 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=ihhzVIUW4OxXRdYi1abiv5CmAl5unSJ6hbD+dzlbpViyi3LmGk3vErncp/HA/0lqc nS9tPJL4djuXzJgzXAG7A3dlp92f05RjU3WCpGluDoMTVTDyUWMN1gM7qo3/+uqdtu eITxWDCZfU3MFITVfD8/s/Rbp6PqFtTyU+TbmGI3dSN8J8RraY1rIMhWND6Hr0lBfT UcKtTwkYjsisncmcKoZKiYP8OtOH27LwF9Qme+RYg8NHRG3FkyV5CPlXz9Av21R+6I mNwuI+CVuhpQ9xwdvVJwWHO4HZhNFjtcZsc9HU/ETyN4+0zZMt7YRnt2tQEWsDpcjF +gIQktL/eHo4A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 970CA69AE6 for ; Thu, 12 Feb 2026 14:16:54 -0700 (MST) 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 XRVqvm0KNIXm for ; Thu, 12 Feb 2026 14:16:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770931014; bh=K4MzQprB9OXsZy00XyS4I/E1tzShsLiHl/uOn0wLF7M=; 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=ihhzVIUW4OxXRdYi1abiv5CmAl5unSJ6hbD+dzlbpViyi3LmGk3vErncp/HA/0lqc nS9tPJL4djuXzJgzXAG7A3dlp92f05RjU3WCpGluDoMTVTDyUWMN1gM7qo3/+uqdtu eITxWDCZfU3MFITVfD8/s/Rbp6PqFtTyU+TbmGI3dSN8J8RraY1rIMhWND6Hr0lBfT UcKtTwkYjsisncmcKoZKiYP8OtOH27LwF9Qme+RYg8NHRG3FkyV5CPlXz9Av21R+6I mNwuI+CVuhpQ9xwdvVJwWHO4HZhNFjtcZsc9HU/ETyN4+0zZMt7YRnt2tQEWsDpcjF +gIQktL/eHo4A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8747C69AD8 for ; Thu, 12 Feb 2026 14:16:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770931012; bh=D/gBWz0w3SZOq52pOkshjAF+oUKMjpOpALw+GqIldVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iIr/Kbo6MjVl9Hj56xlff/LnscrtnT2Zizgj7JTUva26mpQFQfEGTOqyhfy/+2DT/ rq0IfQYlx7yEAHvL+8lYMNWmyRyUGXAvKzkuoIx24gXT9vhndQJPxrCw2qwfPToZec 15NmaGl0VDUZp/CRwnm52FTybgcvs0Ptl1H5fbup2YkxTKsqRuRwcJbg/yF240w/mQ iW4f0QpNMTT/bvFM1Nw8dPXV1tCW92g+5zEkDuSWdERfwG5DS1GA7kcR5/sRNpqkCM +LGYOOEQn2sH1DwQYSa6+/3de3Ul9Mpm/ieix/zuyLqZT4vW8AZ3e8b9yDKJWg4RdO pJ1WwYoStbKkw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 45FFB69ABB; Thu, 12 Feb 2026 14:16:52 -0700 (MST) 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 3CRCYXcZGec0; Thu, 12 Feb 2026 14:16:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770931008; bh=SRr0E3PFNJbaEmvIi/uBPBhdVUF//VEFgpKov2L1o2M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=khgN+nyrZ7Cg0yaf8z/A1GzU+GYr+0FGhTwNueXewLdPB59Ic4WWAY2DaRiwQhF76 fIucb6HbdVcErnJMHLHcORI5y6ul/fwJEw1fNMUTKQ1FyNuwzus5EUTiBnpHkm9H4Z 5DsaAS29MjXZx7cymU0mDkbMv5d2+Np322lBr+oJ0PA3AC5GXtlhS832TqP56zRv7f LfQPu6SGt/DbE7RXcXe8dPR/MFZAAXGM8qPYNsSsXzSzQddIRkQm1c45jg1cIq4L+1 xyQlV1J/R3mTSEMxCiGLVeqQUT8ZPRB7kyoMq7wTdUPhKGpwRdqOGjpeZTLkWCQPQU 7ZUNdF90Ksjgg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 157E76994D; Thu, 12 Feb 2026 14:16:48 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 12 Feb 2026 14:16:16 -0700 Message-ID: <20260212211626.167191-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260212211626.167191-1-sjg@u-boot.org> References: <20260212211626.167191-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HTEEILJJI4CDY55ALTFFF6UHC5OJX47Y X-Message-ID-Hash: HTEEILJJI4CDY55ALTFFF6UHC5OJX47Y 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 , "Claude Opus 4 . 6" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 3/9] pickman: Group named-tuple declarations together 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 Move AgentCommit and ApplyInfo above parse_log_output() so that all named-tuple declarations are together at the top of the file. Fill out the comment for ApplyInfo Co-developed-by: Claude Opus 4.6 Signed-off-by: Simon Glass --- tools/pickman/control.py | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/tools/pickman/control.py b/tools/pickman/control.py index 54e1c568d7b..c88fa567191 100644 --- a/tools/pickman/control.py +++ b/tools/pickman/control.py @@ -79,6 +79,24 @@ CheckResult = namedtuple('CheckResult', [ CommitInfo = namedtuple('CommitInfo', ['hash', 'chash', 'subject', 'author']) +# Named tuple for simplified commit data passed to agent +# hash: Full SHA-1 commit hash (40 characters) +# chash: Abbreviated commit hash (typically 7-8 characters) +# subject: First line of commit message (commit subject) +# applied_as: Short hash if potentially already applied, None otherwise +AgentCommit = namedtuple('AgentCommit', + ['hash', 'chash', 'subject', 'applied_as']) + +# Named tuple for prepare_apply() result +# +# commits: list of AgentCommit to cherry-pick +# branch_name: name of the branch to create for the MR +# original_branch: branch name before any conflict suffix +# merge_found: True if these commits came from a merge on the source branch +ApplyInfo = namedtuple('ApplyInfo', + ['commits', 'branch_name', 'original_branch', + 'merge_found']) + def parse_log_output(log_output, has_parents=False): """Parse git log output to extract CommitInfo tuples @@ -107,19 +125,6 @@ def parse_log_output(log_output, has_parents=False): commits.append(CommitInfo(commit_hash, chash, subject, author)) return commits -# Named tuple for simplified commit data passed to agent -# hash: Full SHA-1 commit hash (40 characters) -# chash: Abbreviated commit hash (typically 7-8 characters) -# subject: First line of commit message (commit subject) -# applied_as: Short hash if potentially already applied, None otherwise -AgentCommit = namedtuple('AgentCommit', - ['hash', 'chash', 'subject', 'applied_as']) - -# Named tuple for prepare_apply result -ApplyInfo = namedtuple('ApplyInfo', - ['commits', 'branch_name', 'original_branch', - 'merge_found']) - def run_git(args): """Run a git command and return output."""