fix(upstream-triage): distinguish subject hints from patch matches (#569)

* fix(upstream-triage): require patch identity before skipping commits

* fix(upstream-triage): retain subject-only ports as verification hints

* changelog: place the #569 entry under [Unreleased]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-10-21 07:21:40 +02:00
1 parent b67eb9e05a
commit 358d167cff
3 files changed
+70 -4

No files matched your search

+13 -4
View File
@@ -18,8 +18,10 @@ Two signals drive the sort:
1. Already applied? A cherry-pick lands with a NEW sha but the same patch, so a
raw sha comparison misreports it as missing. We compute git patch-ids for the
fork-only commits and treat any upstream commit whose patch-id (or exact
subject) matches as already applied.
fork-only commits and treat any upstream commit whose patch-id
matches as already applied. A matching subject with a different patch may be a
conflict-resolved port or an unrelated change: keep it as a distinct verify
reason in the advisory skip list, never as proof of a cherry-pick.
2. Relevant to this fork? A commit that only touches files this fork deleted
(e.g. removed demo portals) is almost certainly N/A. We check each commit's
@@ -175,7 +177,9 @@ def main() -> int:
fork_only = rev_list(f"{ref}..HEAD")
fork_patch_ids = {p for p in (patch_id(s) for s in fork_only) if p}
fork_subjects = {subject(s) for s in fork_only}
fork_subjects = {}
for fork_sha in fork_only:
fork_subjects.setdefault(subject(fork_sha), fork_sha)
try:
common_base = git("merge-base", "HEAD", ref).strip()
except subprocess.CalledProcessError:
@@ -188,9 +192,14 @@ def main() -> int:
for sha in behind:
subj = subject(sha)
short = sha[:9]
if patch_id(sha) in fork_patch_ids or subj in fork_subjects:
if patch_id(sha) in fork_patch_ids:
skip.append((short, sha, subj, "already applied (cherry-picked)"))
continue
if subj in fork_subjects:
match = fork_subjects[subj][:9]
skip.append((short, sha, subj,
f"subject matches fork commit {match}, patch differs: verify"))
continue
if any(sha.startswith(e) for e in wontport):
skip.append((short, sha, subj, "on the fork's won't-port list"))
continue