Repository navigation
Description
bootstrap.py is a pinned copy, so these change together and every project re-pins once. Brett Heap ruled on 2026-10-14 that the stranded commit stays P2: it needs a commit made on a detached leg, off the documented order.
From the v1.1.0 triage of the v1.0.0 known limits on #458. One pull request covers the lines below.
Lines
-
make bootstrapsilently strands a commit made on a detached leg when the branch is already at the pin. Where: templates/assembly-root/scripts/bootstrap.pyplace_at_pin(:255-272). Effort S; all. On main3121945:place_at_pincalls_check_outwith no HEAD check, whereasfast_forward_to_pinrefuses a detached HEAD that is not the pin ("which is neither", :313-322). (source) - bootstrap's
not moving an existing branchsays "The checkout stays at the pin", false when HEAD is on that branch. Where: templates/assembly-root/scripts/bootstrap.py:446-448. Effort S; all. On main3121945: The line is unchanged on main and tests/test_bootstrap_after_bump.py asserts HEAD stays on the branch at its own tip in exactly that case. (source) - Since templates/assembly-root/scripts/bootstrap.py: a tracking branch behind the pin is fast-forwarded to it, and a fresh clone's branch past the pin with no commit of its own is moved back to it, so
bump-leg.pythenmake bootstrap, andgit clone --recurse-submodulesthenmake bootstrap, leave the leg on its branch AT the pin, no longer detached undernot moving an existing branch(#475) #490 bootstrap leaves a leg with own commits past the pin detached; bump-leg print and AGENTS-shape.md still promise placement (what remains of it: bump-leg.py's print and AGENTS-shape.md (README.md and AGENTS.md: 28 statements the v1.0.0 accuracy pass found false are corrected to what the tools do on main (#483) #505 did the other docs)). Where: scripts/bump-leg.py:1514-1515; templates/assembly-root/AGENTS-shape.md:95; shape-doctor.py:3448,3524 docstrings. Effort M; all. On main3121945: Docs half done by README.md and AGENTS.md: 28 statements the v1.0.0 accuracy pass found false are corrected to what the tools do on main (#483) #505 (af01068: AGENTS.md:356, README.md:994, handbook:1370 now say "or says why not"), but bump-leg.py:1515 still prints "re-places it on its tracking branch AT the new pin" and AGENTS-shape.md:95 "places each leg ... not a detached HEAD" (shipped copy, so a re-pin). (source)
Rides along (backlog; tick it here if the same change covers it)
- bootstrap prints
checked out, and then git said:over a checkout git refused while already on the branch (source)
Each line above is marked → this issue on its tracking issue. Tick it there too when this closes.
The lines as written on the tracking issues
make bootstrapleaves a commit made on a detached leg on no branch, and says nothing, when the leg's branch is already at the pin.
- The case:
bump-leg.py --tothe leg branch's own tip, so the branch is at the new pin.- Someone makes a commit on the leg while it is detached there.
make bootstrapruns.place_at_pin(templates/assembly-root/scripts/bootstrap.py:255-272) runs the checkout of the branch and printson main at <pin> (branch tip == pin).- The commit is now on no branch and only HEAD's reflog holds it. The review's run:
23bfef45a582was on 0 branches, with 2 reflog entries, and nothing was printed about it.fast_forward_to_pinguards exactly this case. Its docstring (:296-299) says "checking the branch out would leave it only in the reflog". It refuses with "…the checkout is at (detached), which is neither" (:313-322).place_at_pinhas no such guard.7348c57b^, before templates/assembly-root/scripts/bootstrap.py: a tracking branch behind the pin is fast-forwarded to it, and a fresh clone's branch past the pin with no commit of its own is moved back to it, sobump-leg.pythenmake bootstrap, andgit clone --recurse-submodulesthenmake bootstrap, leave the leg on its branch AT the pin, no longer detached undernot moving an existing branch(#475) #490, behaves the same.- Possible fix: when HEAD is detached at a commit other than the pin,
place_at_pinrefuses asfast_forward_to_pindoes and leaves the leg where it is.
bootstrap's
not moving an existing branchline says "The checkout stays at the pin", which is false when HEAD is on that branch.
- The line is at
templates/assembly-root/scripts/bootstrap.py:446-448.tests/test_bootstrap_after_bump.py::test_a_branch_ahead_of_the_pin_is_not_moved(:239) asserts that HEAD stays onmainat the ahead tip, not at the pin.- Right after a bump the leg is detached at the pin, so the clause is true in that case only.
- Possible fix: name where the checkout is, as the "which is neither" line does.
Since #490 (7348c57),
make bootstrapputs a leg back on its tracking branch only when that branch is at or behind the pin, or ahead of it with no commit of its own; a branch with commits of its own past the pin is not moved, and the leg stays detached at the pin. Three texts still promise more: AGENTS.md:355 and README.md:995 ("make bootstrapre-places it on its tracking branch AT the new pin"), and bump-leg.py's unconditional print after every bump (scripts/bump-leg.py:1513). Every project's AGENTS-shape.md and docs/handbook.html carry the same promise. Lane openRepoShape-5's suggested words, from its read of #490: "make bootstrapin the root puts it back on its tracking branch when that branch is at or behind the new commit, or ahead of it with no commit of its own; a branch with commits of its own past the pin is not moved (bootstrap saysnot moving an existing branch), and the leg stays detached at the pin. Say which when you relay the result." Stale the other way: shape-doctor.py:2914 and :2989 and tests/test_doctor_legs_members_next.py:10 still say bootstrap never moves an existing branch whose tip is not the pin. From lane openRepoShape-5's read of #490 and the review of #490.
— #458, body
bootstrap prints
checked out, and then git said:(templates/assembly-root/scripts/bootstrap.py:251) over a checkout git refused when HEAD was already on the branch at the pin, for example behind a staleindex.lock. Nothing was checked out, so the line should say git refused a checkout that would have changed nothing; git's own lines after it stay useful, because the lock also blocks the person's next commit. Nit 1 of the verification of #490.
— #458, body
Activity
brettheap commentedon Oct 14, 2026
CLAIMED — lane openRepoShape-4, session 11c6c0ef-495a-4a05-94cf-811b7b0a1012@Eagle, 2026-10-14T16:45:41Z, for #533
Logged in
lanes/log/openRepoShape-4.mdatc5c1d452848449d296d5caba3b66698caf65e106.The three reads (lane-collision-protocol Rule 1):
bootstrap.py: a leg detached off the pin is no longer given a branch …
bootstrap.py: the create-path guard needs a HEAD it can read, and tes…
tests/test_bootstrap_after_bump.py: the test for a leg whose gitdir i…
Merge main bbcfd34 into fix/bootstrap-detached-leg: a clean merge of …
shape-doctor.py: the `legs` and `members` NEXT names every detached c…
bootstrap.py: a cherry-pick or revert sequence whose stop was committ…
bootstrap.py and AGENTS-shape.md: a leg with an operation in progress…