Skip to content

bootstrap.py: on a disk that folds case, a leg on Main whose tracking branch main is behind the pin is moved under its own HEAD, and bootstrap says it is on main now over an index that undoes the pin #896

Closed

Description

@brettheap

Goal: bootstrap never moves, with branch -f, the ref HEAD stands on, however the branch name's case is spelled.

Filed by lane openRepoShape-3, from its triage of #458 at the v1.1.1 release commit 5017830: #458's L4-79 (R603, "reasoned only"). #704 deferred it.

State at 5017830.

  • templates/assembly-root/scripts/bootstrap.py:880-881 decides T7 with current != f"refs/heads/{branch}", compared byte for byte. place_at_pin does the same at :814 and :821, and create_at_pin at :1038.
  • Take a disk that folds case (macOS APFS by default, Windows NTFS), with loose refs, and a leg whose branch is main. There, git switch Main puts HEAD on refs/heads/Main, which reads the same loose file as refs/heads/main.

What happens. Once the pin moves past that commit, make bootstrap takes the T7 path.

  1. branch -f main <pin> is let through, because git's "checked out" guard also compares names byte for byte. It moves the file HEAD stands on.
  2. checkout main then finds HEAD already at the pin and changes no file.
  3. Bootstrap prints branch main fast-forwarded <old> -> <pin>, the pin and the leg was on Main, which keeps its commits; it is on main now.
  4. The index and work tree still hold the old commit, so the next commit in the leg reverts the pin's changes.

Evidence. A probe at 5017830 on ext4 emulated the shared file with a symlink .git/refs/heads/Main -> main, which git's files backend reads through:

before: HEAD -> refs/heads/Main | Main = d2ff630956f0 | main = d2ff630956f0 | pin = 6f7543151c73 | f.txt = A
bootstrap: branch main fast-forwarded d2ff630956f0 -> 6f7543151c73, the pin
           the leg was on Main, which keeps its commits; it is on main now
after:  HEAD -> refs/heads/main | HEAD = 6f7543151c73 | f.txt in work tree = A
git status --short: 'M  f.txt'

It was not run on a real APFS or NTFS disk.

Direction.

  • Where current and refs/heads/<branch> are equal under casefold but differ in bytes, leave the leg and say why. Give git -C <leg> switch <branch> as the way out: on such a disk it re-spells HEAD and moves nothing, and the next run takes the on-branch merge --ff-only path.
  • Test it with the symlink emulation, since CI is Linux only.
  • bootstrap.py is a pinned copy, so every project re-pins it.

Size: S.

Lane: openreposhape-3 (openRepoShape-3)

Activity

  1. added this to the v1.2.0 milestone on Oct 18, 2026
  2. brettheap commented on Oct 18, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-10-18T14:32:52Z, for #896

    Logged in lanes/log/openRepoShape-5.md at a252c1caab1c5c9ef4beb405b30dc3a81c9f3e7d.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#896:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#896"`, kept where the row or its body names `#896`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `896` as a whole token:
       none
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions