Repository navigation
Conversation
Added a test to ensure changes made only in a new merge commit are not already merged.
|
A neutral merge changes the verdict for a replay of a reverted patch. At a5ee69f the same proposed tree changes from Run this from the repository root with import runpy
g = runpy.run_path("tests/test_merge_check.py")
c = g["MergeCheckTest"]()
c.setUp()
try:
root = c.git("rev-parse", "main")
c.pr_branch("original",root,g["PARAGRAPH"])
c.merge(11,"original")
c.git("revert","--no-edit","original")
c.git("checkout","-qb","side",root)
c.write("docs/other.md","Independent change.\n")
c.commit("side")
c.git("checkout","-q","main")
c.merge(12,"side")
c.pr_branch("copy",root,g["PARAGRAPH"])
c.git("checkout","-q","copy")
before = c.git("merge-tree","--write-tree","main","copy")
print("before", c.run_check("11=copy"))
c.git("merge","--no-ff","-m","sync with side","side")
print("after", c.run_check("11=copy"))
assert before == c.git("merge-tree","--write-tree","main","copy")
print(c.git("diff","--stat","main",c.git("merge-tree","--write-tree","main","copy")))
finally:
c.doCleanups()Both calls report one patch, already on main. The tree ID comparison passes. The base checker at 867d922 still returns AI-assisted. |
Zipettte
left a comment
There was a problem hiding this comment.
Reviewed and ran the focused merge_check suite: all 17 tests passed, including the new merge-only change regression.
Claimed in the coordination issue.
What changed
A previously merged PR can have a new merge commit whose parents are both on main, but whose result includes a new change. In that case,
git cherryreturns no commits and the check reportsalready-mergedeven thoughgit merge-treewould add that change.Keep the existing fast paths. When a prior merge and matching patch counts would lead to
already-mergeddespite a changed merge tree, check for merge commits reachable from the PR head but absent from main. If any exist, let the normal duplicate/conflict/clean checks decide.Testing
test_merge_check.pytests passed. The new test checked both a content-neutral merge and a merge with a change of its own. The latter returnedalready-mergedbefore the fix andcleanafter it.git diff --check, and the repository's game-data check passed for the changed files.conflict, even thoughgit cherrywas empty.test_image_atomics_guard,test_image_store_d16) also fail on unmodifiedmainat6312c057.This PR is based directly on main. #8807 and #8666 edit the same verdict path for different cases, so the merge order may require rebasing.
AI-assisted (Codex). CPU-only validation, no GPU or game data.