fix(tools): run pr_overlap on git older than 2.45 #1229
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1229"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by hashaam1217 on 2026-10-07T18:32:19Z.
What
tools/pr_overlap.py --branchstopped withIndexError: list index out of rangeon git older than 2.45, such as 2.43 on Ubuntu 24.04 LTS.conflicts()passes the two pull-request-on-main trees togit merge-tree --merge-base=refs/pr/base. git accepts trees there only from 2.45 (RelNotes 2.45.0: "the three trees involved in the 3-way merge only need to be trees, not necessarily commits"). Older git fails with "expected commit type, but the object dereferences to tree type", andmerge()then reads the first line of empty output.scan()wraps each clean merge result in a commit on top ofrefs/pr/base(git commit-tree);hunks()andconflicts()use it.--merge-basewith commits works from git 2.40 (RelNotes 2.40.0). The trees being compared are the same, so reports do not change.merge()raises with git's message whengit merge-treefails, instead of reading an empty result.#819 (
DEPENDSregex), #988 (job summary) and #1228 (conflicts()) also touch this file, on other lines. The commit is stored under the existingtreekey, soconflicts()is unchanged and #1228 merges cleanly before or after this.Tested
Ubuntu 24.04.5, git 2.43.0, Python 3.12.3.
--branchon the branch of #1218: onmainit stops with theIndexError; with the change it prints "No overlap with open pull requests.", which matches a manualgit merge-treecheck against every open pull request.--branchon the head of #1211: reports conflicts with #1163 (Amd64OnlyConverterTests.cppL129-130) and #1226 (X64InstructionDecoder.cppL14, L30-31), so overlaps are still found.--out(the CI mode): onmainit stops with the sameIndexError; with the change it covers the 200 pull requests it lists and writes 79 non-empty reports in 23 s. The report for #1211 names the same two pull requests as--branch.no-such-ref) raisesRuntimeError: git merge-tree ... failed: merge-tree: no-such-ref - not something we can merge.main(df16c4c2): merges without conflicts in both orders, and--branchon the result runs on git 2.43. #1228 on its own stops with the sameIndexErroron git 2.43.tools/check_conventions.py --base origin/main: passed.CI is not affected:
ubuntu-latesthas a newer git.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code