From 335c6e7a07a76ec192731e88670dedd7f3c45e0c Mon Sep 17 00:00:00 2001 From: Pimyn Girgis Date: Fri, 9 Jan 2026 09:34:26 +0100 Subject: pkg/email: extract base-commit hash from emails If the author of a patch series provides a base-commit tag, extract and store the hash. --- pkg/email/lore/parse.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'pkg/email/lore') diff --git a/pkg/email/lore/parse.go b/pkg/email/lore/parse.go index 3b044bf21..29b025a78 100644 --- a/pkg/email/lore/parse.go +++ b/pkg/email/lore/parse.go @@ -25,12 +25,13 @@ type Thread struct { // Series represents a single patch series sent over email. type Series struct { - Subject string - MessageID string - Version int - Corrupted string // If non-empty, contains a reason why the series better be ignored. - Tags []string - Patches []Patch + Subject string + MessageID string + Version int + Corrupted string // If non-empty, contains a reason why the series better be ignored. + Tags []string + Patches []Patch + BaseCommitHint string } type Patch struct { @@ -88,6 +89,9 @@ func PatchSeries(emails []*Email) []*Series { if !ok { continue } + if series.BaseCommitHint == "" { // Usually base-commit is in patch 0 or 1. Check them all to be safe. + series.BaseCommitHint = email.BaseCommitHint + } seq := patch.Seq.ValueOr(1) if seq == 0 { // The cover email is not of interest. -- cgit mrf-deployment