diff options
| author | Pimyn Girgis <pimyn@google.com> | 2026-01-09 09:34:26 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2026-01-09 16:05:14 +0000 |
| commit | 335c6e7a07a76ec192731e88670dedd7f3c45e0c (patch) | |
| tree | 3f64ebd1550aaf0bda5c7535055573773473b093 /pkg/email/lore | |
| parent | 64c076ea8f57b01c61f2a55fbf9e82ef73fd011a (diff) | |
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.
Diffstat (limited to 'pkg/email/lore')
| -rw-r--r-- | pkg/email/lore/parse.go | 16 |
1 files changed, 10 insertions, 6 deletions
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. |
