Skip to content

validate-family.py: gitmodules-path-twice and the check for values git refuses to read still read the work tree's (or HEAD's) .gitmodules where git reads the index's #1077

Closed

Description

@brettheap

Found by RV1069's review of #1069, the PR for #1036 (#1069 issuecomment-6301647287). Both checks behave the same on main 6c861635, so neither is a regression.

1. gitmodules-path-twice reads only the work tree's .gitmodules (templates/family-root/scripts/validate-family.py:4113 at #1069's head).

  • Setup: a second section for members/IRRS, staged in the index's .gitmodules only, with the work tree's file deleted.
  • The local gate exits 0 in every mode.
  • After the commit, a clean clone's git submodule update --init --recursive exits 1. Its gate exits 2 in the two modes that check members, and 1 with --no-members.

2. The check for values git refuses to read reads the work tree's and HEAD's files, never the index's (:2020-2021 at #1069's head).

Context: #1036's fix teaches gitmodules-path-unnamed to read the file git reads, which is the index's and then HEAD's once the work tree's file is gone. These two checks need the same reading. Measured on git 2.43 in a scratch repository: with the work tree's file gone, git reads the index's .gitmodules, even over a section HEAD's file gives. Only when the index holds no .gitmodules does it read HEAD's.

Activity

  1. brettheap commented on Oct 20, 2026

    @brettheap
    ContributorAuthor

    Two more follow-ups from RV1069's round 2 on #1069 (#1069 (comment)), at 8d14a20e. Neither blocks #1069.

    • NIT 3: "then commit" is not enough where HEAD's .gitmodules holds the section. Where HEAD's file still holds the section, the lines end "then commit .gitmodules". If you type only the printed lines and then a plain git commit, HEAD keeps the section. The local gate then passes and a clone's gate fails gitmodules-path-unnamed.
      • In round 1's four composed states, the commit exits 1 ("no changes added").
      • With tools/x committed, the commit exits 0 silently, because the gitlink's removal was staged beside the lines.
      • git commit -- .gitmodules, or git add then git commit, is right in every state.
      • Fix: print git add -- .gitmodules in both branches, and say "then stage and commit".
    • NIT 4: a test gap in the case-variant branch. A mutant that drops the stage line in that branch (validate-family.py:3206-3209 at 8d14a20e) survives all 29 cases. The code is right; only the test is missing.
      • Fix: a row where the stray name is not in HEAD's file would catch it. RV1069's probe test_r2_stray_not_in_head has that shape, and lane 4 keeps it in its scratch.

    Lane: openreposhape-4 (openRepoShape-4)

  2. brettheap commented on Oct 21, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-4, session 11c6c0ef-495a-4a05-94cf-811b7b0a1012@Eagle, 2026-10-21T10:40:00Z, for #1077

    Logged in lanes/log/openRepoShape-4.md at 10d875e077b9445ff12a32858efc6ff7172010e2.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#1077:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#1077"`, kept where the row or its body names `#1077`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `1077` as a whole token:
       none
    
  3. added this to the v1.2.1 milestone on Oct 23, 2026
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