Skip to content

patch, baseline: fix quilt mail series collection and tip.git baseline resolution - #879

Merged
rgushchin merged 8 commits into
mainfrom
fix/quilt-and-tip-patches
Nov 11, 2026
Merged

rgushchin merged 8 commits into
mainfrom
fix/quilt-and-tip-patches

Conversation

@rgushchin

Copy link
Copy Markdown
Member

Summary

Fixes the patchset collection and baseline resolution gaps affecting quilt mail and tip.git maintainer workflows (notably Peter Zijlstra and Thomas Gleixner submissions on LKML):

  1. References:-only series threading (src/patch.rs): quilt mail omits In-Reply-To: on follow-up patches 1/N..N/N, placing the cover letter Message-ID only in References: with dot-separated Message-IDs that share no git send-email hyphen stem. Fall back to the final non-self References: entry when In-Reply-To: is absent or empty (RFC 5322 section 3.6.4).
  2. Cover/patch pair guard (src/db.rs): Require existing_total == 1 in is_cover_patch_pair so standalone 1/1 patches posted in the thread of an incomplete 0/N (N > 1) series do not merge into the multi-part series.
  3. Exclude [GIT pull] requests (src/patch.rs): Filter leading [GIT pull] / [GIT PULL] / [git-pull] subjects without PATCH or RFC tags out of is_patch_or_cover so git request-pull -p emails are stored in message history without creating bogus 1/1 patchsets, while keeping bare [PULL M/N] series (used in QEMU) intact.
  4. Dotted revision tags (src/patch.rs, src/baseline.rs): Prevent dot-adjacent version tokens ([patch V1.1 02/38], [PATCH v6.6]) from matching integer patch revisions in parse_subject_version / promote_reply_patch_subject, and skip v1.x / v2.x patch revision tokens inside non-stable brackets in extract_version_tag.
  5. Unified diff file extraction (src/baseline.rs): Extend extract_files_from_diff to extract sanitized repository-relative paths from --- / +++ / @@ - header triples when diff --git headers are absent (quilt and plain unified diffs), restoring MAINTAINERS tree heuristics, section attribution, and subsystem prompt selection.
  6. tip.git branch & objtool candidates (src/baseline.rs): Map objtool paths to tip.git objtool/core, expand tip.git <subsys>/core candidates with <subsys>/urgent (prioritized when urgent appears in the subject), and append tip/master before linux-next without dropping sibling subsystem trees.
  7. Body baseline tags & unversioned stable backports (src/baseline.rs): Extract explicit pre-diff applies on / based on vX.Y[-rcN] tags from cover letters and changelogs, and query recently updated stable/linux-*.y tracking branches when a Linux submission declares an unversioned stable backport ([PATCH stable ...] or leading commit <sha> upstream.).
  8. Ignore tip-bot2 post-merge notifications (projects/linux/mailing_lists.toml): Add tip-bot2@linutronix.de to defaults.ignored_emails so post-merge [tip: <branch>] commit notifications are not re-ingested as standalone 1/1 patchsets.

Verification

  • make check-pr RANGE=origin/main..HEAD and make check-db-invariants
  • sashiko review --project sashiko --agent origin/main..HEAD (status: clean, 0 findings)

Mailers such as quilt mail omit the In-Reply-To header on follow-up
patches in a series and record the cover letter message ID only in
References (RFC 5322 section 3.6.4 places the immediate parent last in
References). Because quilt message IDs have no shared hyphenated stem
either, leaving in_reply_to unset after thread isolation caused every
patch in a quilt series to land in its own thread and remain an
incomplete patchset.

Populate in_reply_to from the last non-self entry in References when
In-Reply-To is absent or empty, and normalize whitespace and control
characters on both headers consistently with Message-ID.

Fixes: 127dac6 ("fix: enforce thread isolation for multi-part patchsets")
Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
@sashiko-bot

sashiko-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

Sashiko review

Commit 7/8 — 2dd4dc9a baseline: resolve body version tags and unversioned stable backports

  • [LOW] src/baseline.rs:
    test_resolve_body_version_tag_and_unversioned_stable_backport() passes
    --date to git commit without setting GIT_COMMITTER_DATE. git commit --date
    only sets the author date, so both commits receive the current wall-clock
    committerdate while active_stable_branch_candidates() sorts primarily by
    --sort=-committerdate. Because the older commit is attached to linux-6.7.y,
    the assertion passes via the secondary --sort=-version:refname tie-breaker
    and does not test committerdate ordering. Set GIT_COMMITTER_DATE and put the
    older commit on a higher version number such as linux-6.13.y to exercise the
    primary sort.

Full review and stage logs on sashiko.sashiko.dev

@rgushchin

Copy link
Copy Markdown
Member Author

Resolved the sashiko-bot [LOW] finding on Commit 7/8 (d0ff0275b645):

  • Updated test_resolve_body_version_tag_and_unversioned_stable_backport() in src/baseline.rs to set GIT_AUTHOR_DATE and GIT_COMMITTER_DATE explicitly and attach the older EOL commit (2025-01-01T00:00:00Z) to linux-6.17.y while linux-6.18.y and linux-6.12.y point to the newer 2026-10-01T00:00:00Z commit (vec!["linux-6.18.y", "linux-6.12.y", "linux-6.17.y"]), exercising both primary --sort=-committerdate (6.12.y ahead of 6.17.y) and secondary --sort=-version:refname tie-breaking (6.18.y ahead of 6.12.y).

@rgushchin
rgushchin force-pushed the fix/quilt-and-tip-patches branch from 1ec1478 to 5fb8d8b Compare November 11, 2026 20:43
@sashiko-bot

sashiko-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

Sashiko review — v2

Commit 2/8 — 125ffcb1 db: restrict cover-patch pair matching to single-patch series

  • [MEDIUM] src/db.rs: in Database::create_patchset_inner(), adding
    existing_total == 1 to is_cover_patch_pair makes is_cover_patch_pair false
    when an incoming 1/1 patch is compared against an existing 0/N (N > 1)
    cover letter. Because is_singleton only checks total_parts == 1,
    (is_singleton && !is_cover_patch_pair) in thread_compatible now flips to
    true across unrelated threads. If an author posts a standalone 1/1 patch in
    a separate thread within 24 hours of an incomplete 0/N series with the same
    cleaned subject, the 1/1 patch merges into the 0/N series instead of
    forming its own Pending patchset. Require existing_total == 1 for
    is_singleton (or in the thread_compatible and total-parts checks).

Full review and stage logs on sashiko.sashiko.dev

@rgushchin

Copy link
Copy Markdown
Member Author

Resolved the sashiko-bot v2 [MEDIUM] finding on Commit 2/8 (2203853ba0f3):

  • Added existing_total == 1 to cross-thread singleton leniency (is_singleton && existing_total == 1 && !is_cover_patch_pair) in thread_compatible and rejected pairing non-placeholder 1/1 patches with multi-part 0/N (N > 1) cover letters in totals_compatible / series_match in either arrival order.
  • Expanded singleton_reply_does_not_merge_into_multipart_cover in src/tests/api_injection.rs to cover both in-thread and cross-thread 1/1 patches sharing the 0/N cover letter's cleaned title in both arrival orders.

@rgushchin
rgushchin force-pushed the fix/quilt-and-tip-patches branch from 5fb8d8b to e500666 Compare November 11, 2026 21:23
@sashiko-bot

sashiko-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

Sashiko review — v3

Commit 2/8 — 2203853b db: restrict cover-patch pair matching to single-patch series

  • [MEDIUM] src/db.rs: in Database::create_patchset_inner(),
    is_late_own_cover does not check totals_compatible when matching a late
    cover letter against a closed patchset. If a standalone 1/1 reply patch is
    ingested and reviewed before the multi-part 0/N cover letter it replied to
    arrives, is_closed_to_new_parts() is true and is_late_own_cover matches via
    author_match. adopt_series_identity() then overwrites the closed 1/1
    patchset's cover letter identity and subject with the 0/N cover letter, and
    no patchset is created for the 0/N series. Require totals_compatible in
    is_late_own_cover as well.

Full review and stage logs on sashiko.sashiko.dev

In create_patchset, is_cover_patch_pair checked total_parts == 1 on the
incoming message without checking existing_total == 1 on the candidate
patchset (unlike is_cover_patch_pair_in_thread immediately below it).
When an author posted an unrelated standalone 1/1 patch in the thread of
an incomplete 0/N multi-part series, is_cover_patch_pair evaluated to
true, bypassing subject matching and absorbing the unrelated 1/1 patch
into the 0/N series as part 1.

Require existing_total == 1 in both is_cover_patch_pair and cross-thread
singleton leniency, and reject pairing a non-placeholder 1/1 patch with
a multi-part 0/N cover letter in either arrival order.

Fixes: 1e90a98 ("db: group single-patch submissions across author emails")
Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
Subtree maintainers send pull requests created with git request-pull -p
under subjects such as [GIT pull] timers/vdso for v7.4-rc1. Because the
message body includes a full branch diff, parse_email treated every
inline pull request as a standalone 1/1 patchset.

Detect leading [GIT pull] / [GIT PULL] / [git-pull] subject prefixes
that carry no PATCH or RFC tag and mark those messages as non-patch
emails so they are stored in message history without creating bogus
patchsets. Keep bare [PULL M/N] series subjects untouched for projects
such as QEMU where submaintainers post patch series under [PULL].

Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
Regex word boundaries in parse_subject_version matched the digits before
a dot, turning dotted revision tags such as [patch V1.1 02/38] into v1
and stable target tags such as [PATCH v6.6] into patch revision v6
(and causing promote_reply_patch_subject to corrupt [PATCH v6.6] when
injecting a reply version). Meanwhile extract_version_tag matched V1.1
inside [patch V1.1 02/38] and emitted a nonexistent LocalRef(v1.1)
baseline candidate.

Reject version tokens immediately preceded or followed by a dot in
parse_subject_version and promote_reply_patch_subject while continuing
to scan later tokens inside brackets (so [STABLE v6.6 v2] resolves to
revision 2), and skip dotted v1.x / v2.x patch revision tokens inside
non-stable bracket prefixes in extract_version_tag.

Fixes: 0e62b71 ("fix: stricter subject version parsing to avoid false positives")
Fixes: 7e5e3dc ("feat: improve baseline selection robustess and UX")
Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
extract_files_from_diff previously recognized only diff --git a/<path>
headers and returned an empty file list for patches formatted with quilt
or plain unified diff (--- a/<path> / +++ b/<path> without a git diff
header). Returning no touched files prevented MAINTAINERS subsystem
baseline selection, maintainer section attribution, subsystem prompt
loading, and ignored-file filtering for every quilt patchset.

Extend extract_files_from_diff to extract sanitized repository-relative
paths from standard unified diff header triples (--- / +++ immediately
followed by @@ -) whenever a file section is not already introduced by
diff --git, handling modified, added (/dev/null), deleted, timestamped,
and .orig-prefixed headers without matching --- separators or hunk body
lines.

Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
Linux MAINTAINERS lists only <subsys>/core branches for most tip.git
subsystems (such as sched/core, locking/core, irq/core, and timers/core)
and omits a T: line on OBJTOOL (pointing to maintainer-tip.rst via P:
instead). Regression fixes targeting <subsys>/urgent, objtool series
targeting objtool/core or objtool/urgent, and cross-subsystem series
based on tip/master failed to apply whenever mainline or <subsys>/core
had diverged.

Map objtool paths to tip.git objtool/core when tip.git is present in
MAINTAINERS, pair tip.git <subsys>/core candidates with <subsys>/urgent
(prioritizing urgent when the subject carries urgent), and include
tip.git master as a fallback before linux-next without dropping sibling
subsystem trees.

Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
Authors frequently state a series baseline tag in the cover letter or
changelog (for example "The series applies on top of v7.0-rc3" or
"Rebase on v7.2-rc1") without repeating that tag in the subject, and
occasionally submit stable backports under [PATCH stable backport] with
an upstream commit marker in the body and no explicit X.Y branch in the
subject. Without those hints, Sashiko fell through to moving subsystem
and mainline tips where the series or already-merged upstream commit no
longer applied.

Extract explicit vX.Y[-rcN] baseline tags from non-quoted pre-diff body
lines stating what the patch applies or is based on, and fall back to
recently updated linux-*.y branches on the stable remote when a Linux
patch declares an unversioned stable backport.

Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
tip-bot2@linutronix.de posts automated [tip: <branch>] single-commit
notifications to linux-kernel and linux-tip-commits after patches
already posted to LKML are merged into tip.git. Ingesting these bot
notifications caused duplicate reviews of already-reviewed patches and
frequent application failures on commits 2..N of multi-commit pushes
whose parent commits are not yet on any baseline ref.

Add tip-bot2@linutronix.de to defaults.ignored_emails in the Linux
mailing list policy.

Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
@rgushchin
rgushchin force-pushed the fix/quilt-and-tip-patches branch from e500666 to b70e389 Compare November 11, 2026 22:10
@rgushchin

Copy link
Copy Markdown
Member Author

Resolved the sashiko-bot v3 [MEDIUM] finding on Commit 2/8 (775fec9129eb):

  • Added totals_compatible to is_late_own_cover in Database::create_patchset_inner() (src/db.rs) so a late-arriving 0/N (N > 1) cover letter cannot hijack a closed standalone 1/1 patchset via adopt_series_identity().
  • Added a regression assertion in singleton_reply_does_not_merge_into_multipart_cover (src/tests/api_injection.rs) verifying that when the standalone 1/1 reply finishes review (Reviewed) before the 0/4 cover letter arrives, both remain separate patchsets and the reviewed 1/1 patchset preserves its identity and status.

@sashiko-bot

sashiko-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

Sashiko review — v4

✓ No issues found across 8 commits.

Full review log on sashiko.sashiko.dev

@rgushchin
rgushchin merged commit 24590f5 into main Nov 11, 2026
1 check passed
@rgushchin
rgushchin deleted the fix/quilt-and-tip-patches branch November 12, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant