Skip to content

merge_check: pin the revisions for each batch - #7468

Open
Barbital11111 wants to merge 2 commits into
ItsNotRexed:mainfrom
Barbital11111:fix/merge-check-pin-revisions
Open

Barbital11111 wants to merge 2 commits into
ItsNotRexed:mainfrom
Barbital11111:fix/merge-check-pin-revisions

Conversation

@Barbital11111

@Barbital11111 Barbital11111 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Claim: #7333 (comment)

A branch can advance between the history scan and the remaining Git commands. Resolve the base and each distinct PR revision to a commit before scanning, then reuse those IDs for history, patch counts, the merge simulation, and duplicate detection. The JSON report keeps the original input label in its ref field.

This follows #6762 and keeps one history scan per batch. #7443 handles Git launch errors separately.

Validation

Windows 11, Python 3.14.3, Git 2.53.0.windows.2. CPU-only with disposable repositories.

  • All 12 test_merge_check.py tests passed. The new regression merges one branch into main and advances a second branch after the real history query. Upstream e76640014 reported a conflict for that batch, while the patch produced the same JSON and exit code as before the refs advanced.
  • Smoke-tested the command against ab_control_flow: preserve the previous vertex fixture on build failure #7427 with an explicit upstream commit. It reported one new commit, no conflict, and no duplicates.
  • Help, git diff --check, and the repository file-content check passed. No game files used.

Upstream merge

Merged dde82f27e, which includes #6669. The batch still uses its pinned base and head commits and retains the upstream squash-merge tree comparison.

  • All 17 merge-check tests passed on Windows 11 / Python 3.14.3 and WSL / Python 3.12.3, including the squash-merge cases and the batch reference-advance regression.
  • The reference-advance regression still fails with the checker from unmodified dde82f27e. The combined checker retains the original batch result.
  • Help, git diff --check, and the changed-file content check passed.

AI-assisted (Codex).

@leoleahy leoleahy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent Windows 11 / Python 3.14.8 review of 96a84e77 (synthetic inputs, CPU only, no game data).

Checks run

  • python -I tests/test_merge_check.py: 12/12 OK on 96a84e77.
  • Negative control against parent e7664001's scripts/merge_check.py: 1 failure (test_batch_uses_initial_revisions_when_refs_advance, returning exit 1 instead of 0 after refs advance mid-batch).
  • python -m compileall -q scripts/merge_check.py tests/test_merge_check.py, git diff --check e7664001..96a84e77, and git merge-tree --write-tree upstream/main HEAD: all clean.

Code review notes

  • Resolving args.main and all unique requested refs upfront with rev-parse --verify --end-of-options <ref>^{commit} pins the entire batch to a consistent commit snapshot, rejects non-commit objects, guards against option-like ref names, and preserves the original ref string in output rows.

LGTM.

AI-assisted.

@airp1ane

Copy link
Copy Markdown
Contributor

Tested 96a84e7 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass.

Ran the test files this PR adds or changes, from a clean checkout of the PR head: test_merge_check.py - all exit 0.

AI-assisted (Claude Code).

@cryptocxeq cryptocxeq left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent CPU review at 0d7804f672376b1d212da11d7fd8509ddd29bad4 against main 32a50c949e882ae539f2d54be93fadd50ce76cae, native Windows CPython 3.14.0. Review claim.

The tool resolves main and each distinct supplied ref to commit IDs before scanning history. The advancing-ref fixture really updates both main and a PR ref after the history command, then compares the full result to the initial batch. All 17 tests pass; reverting only merge_check makes the new advancing-ref test fail. Repeated user-facing ref labels are retained while comparisons use pinned IDs. This is a batch-consistency improvement, not an atomic snapshot across separate ref-resolution commands.

Commands and results (each changed test module run separately):

  • python -I tests/test_merge_check.py: exit 0; Ran 17 tests in 24.862s.
  • With changed implementation files restored to pinned main and PR tests retained: exit 1.

Only public source and handwritten/synthetic fixtures were used. No game files, keys, external game services, GPU runs or LLVM/SPIR-V tool validation. This is a COMMENT review, not a merge approval.

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.

4 participants