worktree-setup warns of a pin mismatch for extern/luau that the fill does not have: a submodule-update fill is compared with the build checkout's pin

Open Beginner friendly
#2,891 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
git, shell
Domain
tooling

Research direction

Read tools/tests/test_worktree_setup.py and tools/worktree-setup.sh, especially the fill logic around line 340 and warning loop around lines 416-420. Start by running the named test to confirm it fails for a build checkout without extern/luau. Done when the test passes and the script no longer emits the pin warning for a submodule update at the branch’s own pin, while preserving the build checkout comparison for copied fills.

Written by the indexing model from the issue text.

Description

Evidence at 84df471bb

tools/worktree-setup.sh warns that a branch pins a submodule at a different commit than the build checkout has. For extern/luau it also warns when the copy it just made is the branch's own pin:

  • tools/worktree-setup.sh:338 fills extern/luau by copying the build checkout's copy, and records it as filled from that copy.
  • tools/worktree-setup.sh:340 fills extern/luau by git submodule update --init extern/luau when the build checkout has none, and records it as filled from that command. That command checks out the branch's own pin.
  • The warning loop (tools/worktree-setup.sh:416-420) runs over every path recorded as filled, including the one from line 340. It compares the branch's pin with the build checkout's pin (line 418, theirs=$(git -C "$fill_from" ls-tree HEAD "extern/$d" ...)).
  • So when the build checkout has no luau pin and the branch pins one, the copy is at the branch's pin and the warning still names a difference: the copy and the branch agree and the warning says they do not.

Not shown

  • Whether a branch that fills extern/luau through line 340 and also has a build-checkout pin would see the warning in practice. Measured by reading the loop, not by running a setup on such a branch.
  • Whether line 338's copy can differ from the build checkout's pin. The warning is correct for that case, since the copy is the build checkout's content.

Falsifier

A tools/worktree-setup.sh run on a branch whose extern/luau pin equals the commit it fills with git submodule update --init prints no line beginning warning: this branch pins extern/luau. At 84df471bb it prints one whenever the build checkout has no luau pin.

Work

  1. Test first, in tools/tests/test_worktree_setup.py: a build checkout with no extern/luau, a branch pinning luau, and a fill through git submodule update: no pin warning. Red at 84df471bb.
  2. tools/worktree-setup.sh: record the luau fill from line 340 as "filled from this branch's pin", and skip the build-checkout comparison for it (or compare with the commit the submodule update checked out).
  3. Mutant: restore the comparison for the line-340 fill; the test fails with the false warning. Restore the fix; it passes.
Dominant language
C++
Stars
3
Forks
5
Avg merge
4h 37m
Merged PRs (30d)
524

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EchoTools/nevr-runtime

All issues in EchoTools/nevr-runtime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.