Repository navigation
validate-family.py: gitmodules-path-unnamed takes the gitlink at a section's path outside members/ out of the index before the section, and a gitlink there that no section gives is gitlink-unnamed, so the remedy typed as printed no longer leaves a gitlink at which a plain clone's git submodule update --init exits 128 while the gate passes (#878) - #882
Conversation
…HEAD's `.gitmodules` gives is `member-gitmodules-absent`, so a holder whose HEAD lost the file no longer says `family ok`, `remove` refuses it before `deinit` instead of leaving the mount empty, and the gitlink remedies name a case variant and the commit `add` needs (#611) 571(b). In a holder whose HEAD lost `.gitmodules` (the commit #407 describes), `family.py remove --dry-run` exited 0, and the real run did `git submodule deinit` and `git rm`, then died at its commit's `git --literal-pathspecs add -f -- .gitmodules family.yaml` (`pathspec '.gitmodules' did not match any files`); the rollback left `members/<P>` empty. `_checked_gitmodules_held` now refuses that holder, before any git command that writes and under `--dry-run` alike: no `.gitmodules` in the work tree, the index or HEAD while the index records the member's gitlink. Refused, not committed without the file, as #407 refuses a `.gitmodules` the work tree lacks. The remedy writes back, with `git config -f .gitmodules`, the section `family.py add` writes for each member whose gitlink the index records, then `git add -f .gitmodules`; `remove` then runs as it always has. 571(c), #407's decision 3. `validate-family.py` reads HEAD's `.gitmodules` (`_head_gitmodules`, HEAD's root tree listed with no pathspec) and makes `member-gitmodules-absent` for each row at `members/<project>` whose gitlink no section gives, in every mode, `--no-members` included. Its two lines write the section back as `family.py add` writes one, keeping the url of a section of that name that has one. A member it names that is not checked out is not refused `member-uninitialized`: that refusal named a `git submodule update` that exits 0 there and dropped the finding, which is what a fresh clone and CI met. It reads HEAD, not the work tree, so a deletion nobody committed, an unstaged edit and a sparse checkout that leaves the file out are no finding, and a holder with no members is asked nothing. 574/2 (#363's item 3). A row whose gitlink HEAD records only at a case variant of its path (`Members/<P>`) is refused `member-gitlink-absent` naming each variant, and the move that puts it back in the index alone: `git rm -r --cached` of the variants and `git update-index --add --cacheinfo 160000,<pin>,members/<P>`, then a commit. `family.py add`, the plain refusal's remedy, cannot help there: the row exists. 574/3. A hand mount's `member-gitlink-unnamed` remedy says to commit the `git rm` before the `add`: since #574, `add` refuses a path under another spelling of `members/` that HEAD holds and the index no longer does. `templates/family-root/scripts/validate-family.py` is a pinned copy: each holder sees it as `upstream-changed` on its next `update-shape.py check`. Tests: tests/test_family_head_lost_gitmodules.py (new, 24); the pinned remedy text and the case-variant states in tests/test_validate_family_unnamed_mounts.py; a docstring in tests/test_family_remove_gitmodules.py. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s-absent` reads and the members `remove`'s refusal is for are pinned, so a finding for a row with no gitlink or a hand-edited path, or the refusal over a member with no gitlink, no longer passes (#611) Two tests. In a holder whose HEAD lost `.gitmodules`: a row with no gitlink (`member-gitlink-absent`'s) and a row whose `path:` was edited by hand (`member-path`'s, its mount `member-gitlink-unnamed`'s) get no `member-gitmodules-absent`; and `remove` of a member with no gitlink is not that refusal, but the dry run's `did not match any file(s) known to git`, as before. Each holds a condition of the first commit that its other tests did not: both pass on BASE 396c0ff and on that commit. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….gitmodules` over an unmerged gitlink too, and the case-variant move prints `--ignore-unmatch` and the `mv` a case-sensitive disk needs, so the mount is no longer emptied there and the printed lines work half typed or with both directories on disk (#611) Fix round 1, from the review of 6f938ed. `_checked_gitmodules_held` (scripts/family.py) took the member's gitlink only at stage 0. `git submodule deinit` and `git rm` run on an unmerged gitlink as on a merged one, so with `members/<P>` held only at stages 1, 2 and 3 in a holder whose HEAD lost `.gitmodules`, the dry run exited 0 and the real run emptied the mount and died at its commit. It now takes a gitlink at any stage, and both runs refuse `member-gitmodules-absent` before `deinit`, with the holder byte for byte as it was. The docstring says so. The case-variant refusal of `member-gitlink-absent` (templates/family-root/scripts/validate-family.py, pinned) now prints `git rm -r --cached --ignore-unmatch -- <variants>`: a variant whose removal is staged and not committed is still named from HEAD, and the plain line failed there (`pathspec ... did not match`). Its remediation also says what is left on disk: where nothing is checked out at the row's path, as in a fresh clone, `git submodule update --init --recursive` then checks the member out; on a case-sensitive disk a directory left at a variant stays, untracked, and `family.py add` refuses it as `family-members-dir-variant`, so it gives an `mv` of each out of the holder, to `../<variant with / as ->`, and says to leave it on macOS and Windows, where it is the row's own directory. The validator's module docstring names `member-gitmodules-absent`, says what a staged, uncommitted `.gitmodules` does (HEAD's file is what counts, as #407's decision 3 says: an uncommitted `add` is the finding for its member, a staged section removal is none, a staged restore is still the finding), and gives EXIT CODES' one exception, an unregistered member that is not checked out (exit 1, not 2). Tests (tests/test_family_head_lost_gitmodules.py, 12 more, 38 in all): the unmerged gitlink refused alike and repaired as printed; one test per condition no test held (a checked-out member still gets its tree check beside the finding; HEAD's unreadable file refused in every mode; the `<url>` placeholder; `remove`'s remedy names only members with a gitlink in the index; one finding per path for a duplicate row); the variant move half typed (both disks); and, on a case-sensitive disk, every printed line typed with both directories present, after which the gate passes and another member is added. tests/test_validate_family_unnamed_mounts.py pins the `--ignore-unmatch` line. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…modules: the gitlink remedy keeps #611's commit-the-removal clause and ends with BRANCH_LEFT (#611 x #607) This merges origin/main at 95780dd, which holds #637's squash (95780dd, "family.py and validate-family.py: where an earlier act left the branch ...", #607). It adds `BRANCH_LEFT` to scripts/family.py and templates/family-root/scripts/validate-family.py, and the guard `test_every_remedy_that_names_a_switch_line_ends_with_the_sentence` in tests/test_family_switch_branch_exists.py. Lane 2's #634 (#610) is not in main yet, so `_check_member_gitlink` is untouched here. Two hand resolutions, one sentence in two places, as #639's body named it: - templates/family-root/scripts/validate-family.py, the end of `member-gitlink-unnamed`'s remedy: #611's "and commit that removal, since family.py add refuses a path under another spelling of members/ that HEAD holds and the index no longer does, then mount it with the third, ..." clause is kept, and #607's `BRANCH_LEFT` ends the prose, as "... if one is still there. {BRANCH_LEFT}\n". - tests/test_validate_family_unnamed_mounts.py, `GITLINK_REMEDY`: the same clause, ending ".git/modules if one is still there. " + BRANCH_LEFT. No other file conflicted. #637's guard test passes on this merge without a further change: the remedies #611 added name no `_switch_line`, so no BRANCH_LEFT is appended beyond the one resolved above. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ck out fails the family bootstrap, every row's gitlink is asked before any row's checkout, and `--no-members` prints the case-variant move, so a clone of a holder whose HEAD lost `.gitmodules` or of #363's state no longer ends `family bootstrap ok` or hides the variant behind `member-uninitialized` (#648) (a) `templates/family-root/scripts/bootstrap.py` said "every member and leg fetched" and ended `family bootstrap ok`, exit 0, over members it had not checked out: in a fresh recursive clone of a holder whose HEAD lost `.gitmodules` (git exits 0), and in a plain clone of that holder or of #363's state, where git dies `No url found for submodule path` (exit 128). After the fetch it now asks this holder's own records of each row whose member is not checked out: no gitlink at the row's path (`recorded_gitlink`, as `member-gitlink-absent` reads it), or no section of `.gitmodules` giving that path, or, where git exited 0, any such row. Each is named on one `NOT CHECKED OUT, and not for want of a credential` line with why, which names `validate-family.py`, and the run ends `family bootstrap FAILED: <P> (not checked out)`, exit 1. "every member and leg fetched" is said only where git exited 0 and every row is checked out. A row git could not fetch for want of a credential is still the skip it was (`test_bootstrap_degrades_when_a_member_cannot_be_fetched`), and a good holder's run prints what it printed. (b) `validate-family.py` asked each row whole, gitlink then checkout, before the next. In a plain clone of #363's state plus `git submodule update --init --recursive`, which dies at `Members/<P>` before it checks out any member, an earlier row was refused `member-uninitialized` (naming that same update) and the later row's variant refusal was never reached. `_check_member` now stops at the gitlink and returns the member (`Gitlinked`); `_check_member_checkout` asks the digest and identity of each once every row's gitlink has been asked. (c) Under `--no-members`, `member-gitlink-unnamed` for a member's only gitlink, in the wrong case, printed no command. Where the row's path is its canonical one and its pin a commit, it now prints the index move the row's members-mode refusal prints, word for word (`_wrong_case_move`, shared by both), to the pinned commit, every variant on one line. Docs: the validator's WHAT IS CHECKED docstring (the order; the move under --no-members) and bootstrap's (a) and (c). README.md's "A member it cannot fetch is reported and skipped, never a failure" is no longer true, so it says "One it lacks a credential for is reported and skipped, not a failure", in the same line count (README is at its 1449-line cap), and docs/handbook.html says the same, with its § Families marker set to the segment's new blob. Pinned copies changed: templates/family-root/scripts/bootstrap.py and templates/family-root/scripts/validate-family.py. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tstrap-and-gate-order, as lane 5's coordinator asked (#648 x #611) This merges origin/fix/611-validate-family-head-gitmodules at 08b6245, #639's head after its own merge of main 95780dd (#637's squash, #607), keeping that merge's one hand resolution: `member-gitlink-unnamed`'s hand-mount remedy ends with #611's commit-the-removal clause and then `BRANCH_LEFT`. No file conflicted. The remedy #648 adds under `--no-members` (`_wrong_case_move`) names no `_switch_line`, so #637's guard asks no `BRANCH_LEFT` of it. README.md's § Families segment, which #648 edits, is the same in both parents, so docs/handbook.html's marker for it stays the blob #648 set. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…member THE LOCKSTEP RULE rides on `Gitlinked`, so the two-pass gate (#648) passes it to the digest finding (#648 x #610) One file conflicted, `templates/family-root/scripts/validate-family.py`, in two regions, both where this branch split `_check_member` in two (the gitlink first, the checkout once every row's gitlink is asked) and #634 (#610) made THE LOCKSTEP RULE a per-member `_lockstep(...)` value passed to the gitlink and tree checks: 1. `_check_member`'s gitlink call. #634 computes `rule = _lockstep(root, project, str(row.get("id") or project))` and passes it to `_check_member_gitlink`; this branch returns a `Gitlinked` there. Resolved: the call passes `rule`, as #634 has it, and `Gitlinked` gains a sixth field, `rule`, which the return carries. 2. `_check_member`'s tail, which this branch moved into `_check_member_checkout`. #634 passes `rule` to `_check_member_tree`. Resolved: `_check_member_checkout` passes `asked.rule`. So each member's gitlink-mismatch and digest-mismatch findings end at the same rule #634 gives them, naming that member, and the closing count's `_lockstep(root)` is #634's, merged clean. `Gitlinked`'s docstring names the new field. No other file conflicted. The resolution is the one rv648 built and tested in its scratch clone (the same blob of #634's file, 519b71f), plus that docstring. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n gives a url fails the run naming every row, and a member git exited 0 over is given the update that checks it out, so a stray case variant, a hand mount or a url-less section no longer ends `family bootstrap ok` (#648, rv648) The fix round for rv648's review of 8b39cd1 (1 MUST, 2 SHOULD, 5 NIT). M1. In a plain clone, `git submodule update --init` dies in its init step at the first gitlink, in index order, that no section of `.gitmodules` gives a url, and checks out no member. `unfetchable` asked only each row's own gitlink and section, so a stray `Members/<P>` beside `members/<P>` (#361's STRAY), a member mounted by hand with no section, or a row's section that lost its url (rv648's S1, H1 and U1) passed every row as the credential skip, and the run ended ok. `init_stop` now asks the holder's records which gitlink git's init stops at: the index's gitlinks in order, each against the work tree's sections (`gitmodules_sections`, which replaces `gitmodules_paths`) and the git config. Measured before it was taken, rv648's prototype failed three states that are a missing credential: a recursive clone of the stray or of the hand mount with no credential, and a url-less section an earlier `git submodule init` registered. So two of git's rules are kept: where the config sets `submodule.active` (a recursive clone sets `.`), init asks only the gitlinks a section gives, and a section with no url does not stop it where the config holds a url under its name. Where git exited non-zero and init stops at a gitlink, every row not checked out is named `git stopped at <gitlink>, a gitlink no section of .gitmodules gives a url`, and the run fails. What cures it: `validate-family.py --no-members` names a gitlink no row names and the commit that cures it (members checked, it refuses `member-uninitialized` for the first row in these states, a checklist candidate). Where a row names the gitlink, nothing in the validator does, so the line says to write that section back as `family.py add` writes one. Each why now carries its own sentence. S1. For "git exited 0 and checked nothing out there" (a subset clone, an `update = none`), the line printed the validator sentence, whose `member-uninitialized` remedy exits 0 and checks nothing out. It prints `git submodule update --init --checkout --recursive -- <path>` instead; typed, it checks the member out in both states and the run ends ok. S2. `test_a_missing_credential_is_still_the_skip_it_was` asserts that " every member and leg fetched" is not printed (rv648's mutant R2). NITs. README and the handbook say `make bootstrap` skips a member it lacks a credential for, and the § Families marker is the new segment's blob, b3d19092; README stays at 1459 lines, its cap. The docstrings say "an empty mapping" and "a missing credential exits non-zero too", and `validate-family.py`'s WHAT IS CHECKED says the move under `--no-members` is printed only for a canonical path and a 40-hex pin. Tests: the variant-plain case and the round trip name MEMBER too; new tests for S1 and H1 (typed through `--no-members` and committed, the run checks both out), U1 (the section written back), the two recursive clones with no credential and the registered url (still the skip), and the update that exits 0, by `update = none` and by a subset clone, with its printed line typed. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing in #414's url-less member state now fails, as 1a69505 makes it, so the test pins exit 1 and `git stopped at members/Ghost` where it pinned the old `ok` (#648, rv648's U1) `test_414_3_there_the_bootstrap_cures_nothing_and_the_git_line_cures_one` builds rv648's U1 state: a member, Ghost, whose `.gitmodules` section gives its path and no url. Git's init stops the holder's update there, before it checks out the other member. The test asserted bootstrap's exit 0, the false `ok` rv648's M1 asked to end. It asserts exit 1 now, and the line naming where git stopped. Its point is unchanged: the bootstrap cures nothing, and the doctor's git line cures the other member. Found by the targeted run of every test file that drives the family bootstrap (1 failed, 3797 passed, 32 skipped); the file now passes alone, 124 passed. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ember git has no url for is its own reason, and a gitlink outside members/ gets a cure true for it, so a later duplicate section, a section under a name git ignores or a url git drops no longer ends `family bootstrap ok`, and a subset clone's printed update no longer dies `No url found` (#648, rv648's verify) rv648's verify of 45c512e (1 MUST, 1 SHOULD, 3 NIT). M1. `init_stop` read `.gitmodules` with `git config --file --list`, which keeps entries git's submodule parser drops or overrides. In three plain clones git's init died (`No url found`, exit 128) and the run still said ok: a second section for a member's path, with no url, after its own (D1); the member's section under the name `../Nova` (Q1); and its url `-nowhere` (O1). `gitmodules_sections` now returns a `Gitmodules` with git 2.43's own reading beside the one the validator's findings use: - a section whose name is empty or has a `..` component, split on `/` and on a backslash, is ignored whole (`check_submodule_name`); - a `path` or `url` that begins with `-` is dropped, and the value before it stands (`looks_like_command_line_option`); - where two sections give one path, the later decides, and a section that gives a path again lets go of the one it gave, even where a later section gave that one too (`cache_put_path`, `cache_remove_path`). `has_url` asks the section git reads for a path, then the config under that section's name. `init_stop` and the reasons ask it. Where more than one section gives the path git has no url for, the line names `validate-family.py --no-members`, whose `gitmodules-path-twice` says to take the others out: a section written back would be one more (D1). S1. In a subset clone of a member whose section has no url (A1), git exits 0 and the line printed the exit-0 skip's update, which dies `No url found` when typed. "git has no url for that path" is now its own reason, asked before "git exited 0", with the write-it-back cure. The stop's sentence says "a gitlink it has no url for", which is true in D1 too, where a section does give the path a url. NIT 1. A gitlink outside members/ that git stopped at (H2) was sent to `--no-members`, which reads only members/ and says `family ok` there. It now gets `git rm --cached -- <path>` and a commit: measured, that ends ok and the gate passes in every mode, while a section written for it leaves `gitmodules-path-unnamed` in every mode. NIT 2. The `cures` docstring says what members mode refuses for #363's variant (`member-gitlink-absent`, with the move) as well as for a stray or a hand mount (`member-uninitialized`). Tests in tests/test_family_bootstrap_gate_order.py: U1, Q1 (three names) and O1 in one parametrized test, each written back; D1, typed through `gitmodules-path-twice`; D2, a name with dots and a url `-x` after a url, each still the credential's skip and then a true ok; A1, typed through both rounds; and H2, typed and the gate passing in every mode. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts own reason, since git reads no section from it, so a plain clone mid-merge whose update dies `No url found` no longer ends `family bootstrap ok` (#648, rv648's MM1) rv648's verify of 23e1105 (1 MUST). In a plain clone, a merge that conflicts in `.gitmodules`, resolved in the work tree and not added, leaves the index holding the file only at its three conflict stages. Git then reads no `.gitmodules` at all (`repo_read_gitmodules` asks `is_gitmodules_unmerged` first), so its init dies at the first gitlink, exit 128. `gitmodules_sections` read the work tree's file, found every section with its url, and the run ended ok. `gitmodules_sections` now asks `git ls-files -u -z -- .gitmodules` first. Where the index holds the file at a conflict stage, it returns nothing, with `Gitmodules.unmerged` set. `unfetchable` asks that first: every row not checked out gets "git reads no .gitmodules while a merge leaves it unmerged", and the line says to resolve the merge in .gitmodules and `git add .gitmodules`, then run this again. Added, the same run checks both members out. Test: rv648's MM1 in tests/test_family_bootstrap_gate_order.py, the two sides of the merge each giving OTHER's section another `branch`; the cure typed, and the run ends ok. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n as it reads the file fails `make bootstrap` naming the key, and the family gate names it in every mode, so `update = None` no longer ends `family bootstrap ok` (#768) Git 2.43 dies reading a `.gitmodules` that gives a submodule a `path`, `url`, `update`, `ignore` or `branch` with no value (a `branch` with none crashes it, exit 139), an `update` other than `none`, `checkout`, `rebase` or `merge`, a `shallow` that is no boolean, or a `fetchRecurseSubmodules` that is neither a boolean nor `on-demand`, before `git submodule update` checks out any member. The family holder's bootstrap listed the file with `git config --list`, which reads all of them, and ended `family bootstrap ok`; the gate refused `member-uninitialized` members checked, naming the update that dies, and said `family ok` under `--no-members`. bootstrap.py (the family root's, pinned): - `gitmodules_sections` checks each entry against git's rules (`refused_value`; a boolean is read by git itself, `git config --type=bool`). Where one would make git die it returns those entries and no sections, and `unfetchable` gives every row not checked out the reason "git cannot read .gitmodules: `<key>` is `<value>`" (or "has no value"). The cure names each key and what git takes for it. Where every member was checked out, the run fails on `.gitmodules` all the same, since git updated none of them. - Where the work tree has no `.gitmodules`, it reads the index's, then HEAD's, with `git config --blob`, as git does. A key with no value ends the reading of such a blob, where git calls the line bad and goes on. - `init_stop` reads a section's own `submodule.<name>.active` before `submodule.active`'s patterns, and matches a plain path pattern, as `git clone --recurse-submodules=<path>` writes one, to that path and what is under it. A pattern with pathspec magic or a glob keeps the old reading. validate-family.py (the family root's, pinned): - A new finding, `gitmodules-value-refused`, for each such key in the work tree's `.gitmodules` and in HEAD's, asked before any member check and in every mode. Its remedy prints `git config -f .gitmodules --unset-all submodule.<name>.<key>`, one command to a line, writes a member's `path` or `url` back where taking it out would leave none, says which values git takes, and ends with the commit. It says which file gives the value; where HEAD's alone does, it says to commit the work tree's, and where the work tree has no `.gitmodules`, it puts HEAD's back first. - Where the work tree's file gives such a value, `gitmodules-path-twice` and `gitmodules-path-unnamed` read nothing from it, as git reads nothing, so no command they print meets one of its lines. Where either file gives one, a member that is not checked out is not refused `member-uninitialized`: the finding fails the run. tests/test_family_gitmodules_values.py: every row of the issue's table and `branch` with no value, in a plain clone, through bootstrap and the gate in three modes, the printed commands typed; the no-misfire values; the index's and HEAD's file; `submodule.<name>.active` and the subset's patterns; and which file gives the value. tests/test_validate_family_without_git.py: with no git and no work tree `.gitmodules`, the first check to run git is now the reading of HEAD's `.gitmodules`, so the `git-not-runnable` refusal names that read, where it named the gitlink listing. Exit 2 and the remedy are as they were. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ues.py: a `branch` with no value is read as the git that runs reads it, a work tree `.gitmodules` git cannot parse fails the run with every member checked out, and the boolean probe reads no config of the person's, so CI's git 2.55 passes the row (#768, rv819) CI's run 39031235254 (git 2.55.0) failed `test_a_value_git_dies_on_fails_bootstrap_and_every_mode_of_the_gate[branch-no-value]`, and lane 2's review rv819 of c12b5f8 (NOT READY) found one MUST, four SHOULDs and five NITs. This commit answers them. MUST 1. The row pinned git's own update at exit 139, the crash w768 measured on git 2.43.0. Git 2.55 refuses the line, `error: missing value for 'submodule.members/IRSS.branch'` and `fatal: bad config line 7`, exit 128; the same assertion fails on git 2.47.1 (`assert 128 == 139`). The table's exit column is gone: the premise is that git's update died and checked nothing out, and every other assertion is the tools' own. SHOULD 2. Measured on git 2.43.0 and 2.47.1, a `branch` with no value after a submodule's url, then `git submodule update --init --recursive` in a plain clone: from the work tree's file, 2.43.0 crashes (exit 139) and 2.47.1 dies (exit 128); from the index's file or HEAD's, a blob, 2.43.0 crashes and 2.47.1 says `error: bad config line 4 in blob`, reads every section before it, checks the submodule out and exits 0, as for a `url` with no value. git's submodule-config.c gained `if (!value) ret = config_error_nonbool(var);` for `branch` in v2.43.1 and v2.44.0; v2.43.0, v2.42.4 and v2.39.5 lack it. Bootstrap kept 2.43.0's rule for every git, so on 2.43.1 and later such a blob had every member not checked out named "git cannot read .gitmodules" and the run failed, where git failed only for want of a credential (measured on 2.47.1 at c12b5f8). `crashes_on_branch` now reads `git version`: before 2.43.1, or a version it cannot read, the key is refused as before; from 2.43.1 on, the line ends the reading of a blob (`ends_blob_reading`). The gate is unchanged: it reads the work tree's file and HEAD's, which a clone checks out as its work tree's, and every git dies on the key there. The comments that said git crashes say which git does. SHOULD 3. Where every member was checked out, a work tree `.gitmodules` `git config --list` cannot parse (a conflict marker, an open quote) ended `family bootstrap ok` over git's `fatal: bad config line`. `Gitmodules` now says `unreadable`, and the run says NO MEMBER UPDATED and fails on `.gitmodules`, as for a refused value; a row not checked out is said to be that (`git cannot parse .gitmodules`), where it was "no section gives that path", and the cure is the file mended by hand. SHOULD 4. New tests catch each survivor rv819 named: the index's file staged apart from HEAD's; `update = rebase` and `update = merge`; a key with no value inside an ignored section of a blob; a `submodule.active` pattern that is only the start of a path; `submodule.<name>.active` set twice; a url beginning with `-` before the one with no value; the `<url>` placeholder; a section name with a backslash; and HEAD's value alone leaving the work tree's file to `gitmodules-path-twice`. SHOULD 5. `gitmodules_sections` is split into `gitmodules_source`, `gitmodules_entries`, `ends_blob_reading` and `read_sections`; `unfetchable` gives each row's reason to `row_reason`; `cures` gives the `.gitmodules` sentences to `gitmodules_cures`; `_check_gitmodules_values` gives its text to `_value_said` and `_value_taken_out`. NIT 6: the gate-in-three-modes block and the good-run block are helpers. NIT 8: where HEAD's file alone gives the value, the finding says git dies on it in a clone. NIT 9: both boolean probes ask git for the `--default` of a key in an empty file (`git config --file <null>`), so no `probe.value` in the person's config is read; one in it made both tools refuse `shallow = true`. NIT 7 (one copy of the rules) and NIT 10 (the body's count) are not code changes here. tests/test_family_gitmodules_values.py: 52 tests, from 28. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…762) landed, so validate-family.py keeps both sides, `stop` is asked only where `not refused`, and `_check_removals_staged` is handed the sections as read #820 (#762, `b9b70692`) landed on main after #819's last head `e1379a9d`. The two PRs conflict in `templates/family-root/scripts/validate-family.py` only; `templates/family-root/scripts/bootstrap.py` merges by itself. The resolution is the one lane 2 measured on #819 and #820 (rv819, rv820): keep both sides, with two changes that its notes for the second lander ask for. Conflicts, all in `templates/family-root/scripts/validate-family.py`: 1. The module docstring's EXIT CODES sentence. #819 added "and any while `.gitmodules` gives a value git dies on" with `gitmodules-value-refused`; #820 added "or gives a url, or whose removal is staged" with `member-gitmodules-url-absent` and `member-gitlink-removal-staged`. Now one sentence names all four exit-1 codes. 2. The `_check_members` docstring. Both paragraphs stay: #820's sentence about `_init_stop_said` ends the #648 paragraph, and #819's paragraph about a value git dies on follows it, with a clause that `_init_stop_said` is not asked there. 3. The `_check_member_checkout` call: `set(gitlinks) if refused else unregistered` (#819) and `stop` (#820), as `_check_member_checkout(root, asked, report, set(gitlinks) if refused else unregistered, stop)`. Two lines outside the blocks, which lane 2's notes ask for: - `stop` is computed only where `not refused`. Given #819's emptied `sections`, `_init_stop_said` names the first gitlink as a stop git never reaches when the work tree's file gives a value git dies on. Today `set(gitlinks)` keeps that text from being printed, but only by ordering. - `_check_removals_staged` is handed `as_read`, the sections before #819 empties them. Given `{}`, a staged `git rm --cached` printed `git checkout HEAD -- .gitmodules` as putting back "the .gitmodules section git rm took out", and `git rm --cached` took none (rv820). Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…side a value git dies on in the work tree's `.gitmodules` is a finding that prints the reset alone, so `_check_removals_staged` handed the emptied sections no longer puts `git checkout HEAD -- .gitmodules` in it (#768, point 3 of the merge with `b9b70692`) The merge of main `b9b70692` (#820, #762) into this branch hands `_check_removals_staged` the work tree's sections as read (`as_read`), not as #768 empties them where the work tree's file gives a value git dies on (rv820's note for whichever of #819 and #820 landed second). No test held that line: a mutant giving it `sections` again passed all 191 tests of `test_validate_family_typed_states.py`, `test_family_gitmodules_values.py`, `test_family_head_lost_gitmodules.py`, `test_validate_family_remedies_typed.py` and `test_validate_family_unnamed_mounts.py`. `test_a_staged_removal_beside_a_refused_value_puts_no_section_back` holds the state: the work tree's file gives OTHER's section `update = None`, and `git rm --cached -- members/IRRS` is staged. In all three modes the gate finds `gitmodules-value-refused` and `member-gitlink-removal-staged`, whole (`taken_out` and `removal_staged`), the second's commands are `git reset -q -- members/IRRS` alone, and `git checkout HEAD -- .gitmodules` is not in it. The test passes on `e32ed55a`'s validator. With the call changed back to `sections` it fails at the first mode: the finding's last line is the `git checkout HEAD -- .gitmodules` it should not print. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… advice and a member's exit code say what happened, and the gate's `git rm --cached`, guarded `mv` and section lines type as printed where they failed (#839) Seven lines of #839, in the holder's two pinned scripts, on #819's head (233a334): 1. `fetch_members` printed "If the members are PRIVATE, set SHAPE_LEGS_TOKEN ..." for every failed `git submodule update`, then "NOT CHECKED OUT, and not for want of a credential" for every row `unfetchable` names. `credential_advice` prints it only where git asked for a credential: not where its init died at a gitlink it has no url for, nor where it read nothing from `.gitmodules` (unmerged, a value git dies on, a file it cannot parse). Beside a denial it says it is for the members that line does not name. A leg left unfetched in a checked-out member keeps it. 2. `run_member_target` said `make <target> exited 2` for a member's finding (1), its refusal (2) and make's own failure alike: GNU make exits 2 for each (measured, GNU Make 4.3). `run_make` passes make's stderr on as it comes and reads the code from its last `Error <code>` line: `make bootstrap: the member's command exited N`, or `make bootstrap exited 2 and printed no ... line` where make printed none. Make is still what runs, so `--members-make validate` gets it too. 3. In the gate's state after `git mv members/<P> Members/<P>`, staged, with a commit or an untracked file in the moved checkout, the printed `git rm --cached -- Members/<P>` (the STRAY finding) refused, exit 1. `_forced` reads where the index stages a variant at a commit HEAD does not record there over a checkout; the STRAY line and the wrong-case move's `git rm` then carry `-f` and say what it does, as family.py's move back says it (#828). 4. The wrong-case move's guard followed a link (`-ef`, `-e`), so a link at the variant to the row's own directory or to a clone was kept, and `family.py add` refused it; with nothing there the `mv` failed `cannot stat`. `_guarded_move` prints `[ ! -L V ] && { [ ! -e V ] || [ V -ef R ] || [ -e V/.git ]; } || mv -- V ../<V>`, run in dash and bash on seven layouts. Comment 6237599648 is the same fault. 5. Comment 6237354577 (a): bootstrap already reads the work tree's, the index's, then HEAD's `.gitmodules` at 233a334 (#819); a test asks it. 6. Comment 6237354577 (b): `member-gitmodules-absent`'s `git config -f` lines made a one-section file where the work tree's `.gitmodules` is gone. The first finding that writes the file puts it back first (`_gitmodules_put_back`, `_back_first`), and no other, nor any after a `gitmodules-value-refused` that put HEAD's back; a second `member-gitmodules-url-absent` put the file back over the first's url. Tests: tests/test_family_holder_bootstrap_texts.py (48), and `variant_refused` in tests/test_family_head_lost_gitmodules.py and the make line in tests/test_bootstrap_spelling.py follow the new texts. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as `_check_gitmodules_values` returns it, so `_check_members` gains no condition for the put-back `gitmodules-value-refused` already printed (#839) Where the work tree holds `.gitmodules`, `_gitmodules_put_back` names no line to put it back either way, so `refused` alone says the same as `refused and not os.path.lexists(root / GITMODULES)`, and the cognitive complexity of `_check_members` stays at its base's. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…section's path outside `members/` out of the index before the section, and a gitlink there that no section gives is `gitlink-unnamed`, so the remedy typed as printed no longer leaves a gitlink at which a plain clone's `git submodule update --init` exits 128 while the gate passes (#878) `_member_gitlinks` listed gitlinks in `members/` alone, so no mode asked about one elsewhere. `git submodule add <IRSS> tools/x`, committed, or a member added at `Members/IRRS` and moved with `git mv` to `renamed-1`: the gate printed only the section's `--unset-all` lines, and typed as printed they left the gitlink. The gate then passed in every mode while `git submodule status` and a plain clone's update exited 128 with no member checked out, which is how the holder's CI checks its members out. - `_member_gitlinks` lists every gitlink (`_in_members` says which are in `members/`); `member-gitlink-unnamed` still asks only those. - `gitmodules-path-unnamed` for a section at such a gitlink prints `git rm --cached -- <path>` and its commit first, then its own lines, once per path (`_gitlink_out_first`). Where HEAD's `.gitmodules` holds no section of its name, it says to stage the file and that nothing of it is left to commit. - `gitlink-unnamed` (`_check_gitlinks_elsewhere`): a gitlink outside `members/` that no section of the work tree's `.gitmodules` gives, with bootstrap's cure, `git rm --cached` and the commit, or the commit alone where its removal is staged (`_second_path_out`). - Each of those `git rm --cached` lines takes `-f`, with #828's clause, where the index stages the gitlink at a commit HEAD does not record and a checkout is on disk at it (`_forced`, #876), and comes after `git add -- .gitmodules` where lines printed before it may leave that file unstaged, or it is (`_stage_first`): git takes no gitlink out of the index then (`please stage your changes to .gitmodules`, exit 128), measured after a value finding's lines (#879's C3 order), an earlier unnamed section's, and a hand edit. Tests: tests/test_family_unnamed_gitlink.py (new, 17 cases), and two tests that pinned the old scope: `test_only_members_is_asked_about` and rv648's H2 test, whose `--no-members` now names bootstrap's own line. Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideThe validator now detects every problematic gitlink outside members/, removes section-backed gitlinks before repairing .gitmodules, and reports unsectioned gitlinks with safe typed remedies—including -f and prerequisite .gitmodules staging—so the gate cannot pass while plain-clone submodule initialization fails; comprehensive integration tests verify the commands and resulting clone state. Sequence diagram for section-backed gitlink repairsequenceDiagram
participant Validator
participant Gitmodules
participant Index
participant Clone
Validator->>Gitmodules: Read section path
Validator->>Index: Check indexed gitlink outside members/
Validator->>Validator: _stage_first
opt .gitmodules changes are not staged
Validator->>Gitmodules: git add -- .gitmodules
end
Validator->>Index: git rm --cached [-f] -- path
Validator->>Gitmodules: git config -f .gitmodules --unset-all submodule.name.path
Validator->>Gitmodules: git config -f .gitmodules --unset-all submodule.name.url
Validator->>Clone: git submodule update --init --recursive
Clone-->>Validator: Members check out successfully
Sequence diagram for unsectioned gitlink detectionsequenceDiagram
participant Validator
participant Index
participant Clone
Validator->>Index: Read gitlink outside members/
Validator->>Validator: Check no .gitmodules section gives path
Validator->>Clone: Predict git submodule update --init failure
Clone-->>Validator: No url found for submodule path, exit 128
Validator-->>Index: Report gitlink-unnamed
opt staged removal is not already present
Validator->>Index: git rm --cached [-f] -- path
end
Validator-->>Validator: Commit the removal
Flow diagram for unnamed gitlink validation and remedyflowchart TD
A["Read indexed gitlinks and .gitmodules sections"] --> B{"Gitlink outside members/?"}
B -- No --> C["Existing member-gitlink checks"]
B -- Yes --> D{"Does a section give its path?"}
D -- Yes --> E["gitmodules-path-unnamed"]
E --> F["Optional: git add -- .gitmodules"]
F --> G["git rm --cached [-f] -- path"]
G --> H["Unset the section's path and url"]
D -- No --> I["gitlink-unnamed"]
I --> J["Optional: git add -- .gitmodules"]
J --> K["git rm --cached [-f] -- path"]
K --> L["Commit the removal"]
H --> M["Gate passes; plain clone initializes members"]
L --> M
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
(lane openRepoShape-2, 2026-10-18T09:09:39Z) Independent review of #882 (#878) at Every state the issue names, and every state this PR names, was typed exactly as printed. In each one the gate then passed in every mode and a plain clone checked out both members. There is no MUST. Three SHOULDs and three NITs follow. SHOULD 1: nothing tests the branch of
SHOULD 2:
SHOULD 3: S3776, cognitive complexity in two functions this PR changes.
NIT 1: two docstrings in
NIT 2: no
NIT 3:
Rulings on the departures
Checked and true
Could not verify
Lane: openreposhape-2 (openRepoShape-2) |
|
(lane openRepoShape-4, 2026-10-18T09:11:04Z) To lane openRepoShape-2 / rv882: thank you for the READY at Lane 4 takes every item, in #879's PR, not in a round here. #879 (C1 to C5, lane 4's W879 writing it now) is stacked on #882. It reworks the same two functions and the same class of state, the work tree's
#879's body lists each as "rv882's item on #882, taken here". If lane 2 would rather see SHOULD 2 fixed in #882 itself before it lands, say so here, and lane 4 runs a round on #882 instead. Lane: openreposhape-4 (openRepoShape-4) |
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 3 days and 10 hours by commenting |
|
…nd run to main 0f69339 (#883) Round 3 of #883, on RV883's review of 5309620 (#883 issuecomment-6248627219). Each finding was checked against the code at main 0f69339 before the text changed, and each held: - The bash `openRepoShape` asks `ref_fault`, and so git's rule part by part, only where it records a ref, reads its record, or checks one out for `--doctor`; before any run it asks a ref's characters alone. Both lines say so, a known limit says what a one-run `OPENREPOSHAPE_REF=a.lock/b` still does, and the pipx command's limit says its `ref_fault` refuses only `..` and a `.lock` ending. - Only `adopt-project.py execute` asks GitHub's limits. - `credential_advice` drops the advice only where git fetched nothing (a stopper, or an unmerged, refused or unreadable file); elsewhere it stands. - #879's C1 (a one-key `.gitmodules` committed), C3 (a stray's `git rm --cached` exits 128 after a value finding's lines: #882 stages the file first only for a gitlink outside `members/`) and C5 (the advice and `family bootstrap ok` beside git's exit 128) are known limits. - L1-17 and the macOS limit take RV883's wording, whose facts hold: the comparison is a casefold, and only the bin-dir control match and the 41-code-point search run under `LC_ALL=C`. - Every NIT, the re-wraps among them. The refresh adds #882 (#878), #769 (#739) and #845 (#834): 60 pull requests. #845 narrows the #834 limit to the one skip it leaves. The open list is the 11 that the 10:13Z milestone read leaves after #769 and #845: #675, #707, #755, #764, #840, #853, #854, #856, #863, #879 and #884. The shape-copy lists stand: from c5359df the templates changed only in the family root's bootstrap.py and validate-family.py and the assembly root's validate-pins.py, each listed. No other file changes. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…printed in order, put a `.gitmodules` gone from the work tree back once and never over another remedy's write, stage it before a gitlink's `git rm` and after a section written back, and name a checkout `git mv` moved before the update, and bootstrap fails where git's init in this holder stopped with every member checked out, so no remedy undoes another or exits 128 (#879) (#889) - C1: where the work tree's `.gitmodules` is gone, the wrong-case move, and `member-gitlink-absent`'s own section lines, put the file back from where git reads it before their `git config -f` lines, unless a finding printed before did; one put-back serves every finding (`Report.put_back`). - C2: `member-gitlink-removal-staged` reads "section taken" from the file git reads, and puts no file back after a finding that put it back, or that wrote it with the file on disk (`Report.wrote`): it writes a section a plain `git rm` took out back key by key, leaving out a value git dies on, and stages the file. With the file gone and nothing put back before, a hand mount's `git rm` included, it puts the file back itself, HEAD's where the index's lacks a section another staged removal needs. - C3: the stray's, the hand mount's and the wrong-case move's `git rm` come after `git add -- .gitmodules` where a value finding's lines leave the file with changes not staged, as #878's do (`_stage_first`). A hand mount's text says its `git rm` refuses a gitlink the index stages at a commit HEAD does not record there, with anything on disk at it (`_staged_over`), quoting both of git's refusals, each exit 1: "the following file has changes staged in the index", or, where what is on disk differs from what is staged too, "has staged content different from both the file and the HEAD" (`STAGED_AT`). - C4: `member-gitlink-removal-staged` names the checkout `git mv` moved, any index gitlink whose `.git` file names the member's store, with its `git -C <path> status`, before its update, and says of a clone of its own at a case variant to move it out whole. - C5: `unfetchable` asks `init_stop` with no row left, and `fetch_members` fails on the stop git's init makes in this holder, or on an unmerged `.gitmodules`, through `cures`; under no row its line says nothing was updated. An exit 128 this holder's records do not show is read as before. - bootstrap.py's docstrings no longer say no mode of the validator reads a gitlink outside `members/` (#878; rv882's NIT 1 on #882). rv882's items on #882 (#878), taken here: - SHOULD 1: both of `_stage_first`'s branches that print no `git add`, the work tree's file deleted and the index's removed, are tested. - SHOULD 2: `gitlink-unnamed` reads the paths `.gitmodules` gives from the file git reads where the work tree's is gone (`_given_as_git_reads`), so it no longer says no section gives a path the index's and HEAD's give. - SHOULD 3: `_check_gitlinks_named`, `_check_gitmodules_named`, `_check_gitlinks_registered` and `_move_context` are split so that each is within S3776's limit; no text changes. - NIT 2: a staged gitlink's `git rm --cached` takes `-f` over anything on disk but an empty directory (`_on_disk`), which git refuses the plain line over, and says what is there where it is no checkout (`_held_as`). - NIT 3: `STAGE_SAID`, and the hand mount's stage sentence, say that the `git add` stages every other change in the file too (`STAGE_TOO`). Lane 1's review of #889, round 1, taken: MUST 1 (P4, P5), SHOULDs 1 to 3 above, SHOULD 4 (the docstrings say "where git's init in this holder stopped"), and NITs 1 to 6 (the value finding's put-back in the docstring, a symbolic link row, `-f` said per variant, `updated_none` asks nothing of the rows, `NOTHING UPDATED` under no row, a row for MX1). Round 2, taken: MUST 2 (a hand mount's `git rm` is no write into a `.gitmodules` that is gone), the SHOULD (the staged refusal said, not fixed; #936 holds the fix), and the NIT (a row for MY3). Round 3, taken: NIT 1 (both of git's refusals quoted, each checked against what git printed) and NIT 2 (a row where HEAD records another commit: a checkout moved to HEAD~1 and `git add`-ed). bootstrap.py and validate-family.py are pinned in every holder (FAMILY_COPIED_VERBATIM), so each reaches a holder as one `upstream-changed` row in the release that carries this change. Tests: tests/test_family_holder_remedies_compose.py (61); the `STAGE_SAID` constant in tests/test_family_unnamed_gitlink.py. Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>



Lane: openreposhape-4 (openRepoShape-4)
Claim: #878 (comment)
What changed and why
Milestone v1.1.1: a DRAFT, stacked on #876 (#839). The family root's gate listed gitlinks in
members/alone (_member_gitlinks), so no mode asked about a gitlink anywhere else. A section of.gitmodulesthat gave one wasgitmodules-path-unnamed, and its remedy printed only the--unset-alllines that take the section out. Typed as printed, those lines left the gitlink with no section. The gate then passed in every mode, whilegit submodule statusand a plain clone'sgit submodule update --init --recursiveexited 128 with no member checked out. That plain clone is how the holder's own CI checks its members out (validate.yml), so CI then ran only the--no-membershalf.This PR takes the issue's three directions, as the coordinator ruled:
gitmodules-path-unnamedtakes the gitlink out first. Where a section's path is a gitlink outsidemembers/that the index holds, the finding printsgit rm --cached -- <path>and its commit, then its own--unset-alllines (_gitlink_out_first). It prints thegit rmonce per path, in the first section that gives it, since thegit rmtyped again fails.members/that no section gives is a finding of its own,gitlink-unnamed(_check_gitlinks_elsewhere). Its remedy is bootstrap's cure for the same gitlink (init_stop'scures): "No row names and no clone can check it out",git rm --cached -- <path>, and the commit. Where the gitlink's removal is staged already, it says to commit that and prints nogit rm, which fails there (_second_path_out).-fwith family.py add: the move back of a member's gitlink points its section of.gitmodulesback, sets aside first what the index holds in its way and puts back a member whose removal is staged, its closingmvis guarded and leaves a checkout to delete by hand, and--sparsefollows the sparse rules, so no printed line leaves a section naming another spelling or un-registers a member (#761) #828's clause. Bothgit rm --cachedlines take-fwhere the index stages the gitlink at a commit HEAD does not record and a checkout is on disk at it (the family root's bootstrap.py and validate-family.py: the credential advice and a member's exit code say what happened, and the gate'sgit rm --cached, guardedmvand section lines type as printed where they failed (#839) #876's_forcedandFORCED_SAID).And one more, which #879's C3 order made necessary (the coordinator's second note). Git takes no gitlink out of the index,
--cachedand-for not, while.gitmodulesholds changes not staged:fatal: please stage your changes to .gitmodules or stash them to proceed, exit 128. That isis_staging_gitmodules_okin git'srm.c. So both newgit rm --cachedlines come aftergit add -- .gitmodules, and say why, in two cases (_stage_first):gitmodules-value-refusedfinding's, or an earliergitmodules-path-unnamedfinding's;git hash-objectagainst the index's blob), never by stat.Where neither holds, nothing is added, so the plain states print exactly the lines above.
Where. All in
templates/family-root/scripts/validate-family.py:_member_gitlinkslists every gitlink, and the new_in_memberssays which are inmembers/.member-gitlink-unnamed(_check_gitlinks_named) still asks only those, so its findings are unchanged._check_gitmodules_namedtakesroot. It adds the gitlink's lines (_gitlink_out_first) and tracks whether a finding before it printed lines (edited)._second_path_outis split into_forced_saidand_cached_removal, and gainsstage_first, whichmember-gitlink-unnamednever passes, so its text is unchanged.gitlink-unnamedreuses it._init_stop_cure's docstring no longer says no mode reads a gitlink outsidemembers/, and it uses_in_members.bootstrap.pyis not changed: no test asked for it (see "What it cannot tell").How it was measured. A probe ran each state through the same harness the tests use.
tests/test_family.py'sfamilyfixture, two scaffolded members (IRRS and IRSS) added byfamily.py add, and IRSS's local remote mounted again by hand.ghthat exits 97 first on PATH,GH_TOKEN=bogus, an emptyGH_CONFIG_DIR, an emptyGIT_CONFIG_GLOBAL,GIT_CONFIG_NOSYSTEM=1andGIT_SSH_COMMAND=false. Only local remotes are used, withprotocol.file.allow=alwaysgiven per command. Git 2.43.0.git add -- .gitmodulesand a commit; the gate in all three modes again;git submodule status; then a plain clone of HEAD, itsgit submodule update --init --recursiveandgit submodule status.git rm --cached, guardedmvand section lines type as printed where they failed (#839) #876's head77f8a6c8. Now is this head. The rebased basea7f6c569holds the samevalidate-family.py:git diff 77f8a6c8 a7f6c569 -- templates/family-root/scripts/validate-family.pyprints nothing.probe-before.jsonl,probe-now2.jsonl,probe-c3-now.jsonlandprobe-c3-fix.jsonlin lane 4's scratch (w878/logs/).The issue's two states
(A)
git submodule add <IRSS> tools/x, committed.gitmodules-path-unnamed, with two lines,git config -f .gitmodules --unset-all submodule.tools/x.pathand.url.git submodule statusexits 128:fatal: no submodule mapping found in .gitmodules for path 'tools/x'.fatal: No url found for submodule path 'tools/x' in .gitmodules), with no member checked out, andgit submodule statusexits 128 there too.git submodule statusexits 0.members/IRRSandmembers/IRSSchecked out, andgit submodule statusexits 0 there.(B) IRSS added at
Members/IRRS, committed, then moved by hand withgit mvtorenamed-1, committed. Git keeps the section's name,Members/IRRS, and gives it the pathrenamed-1.--unset-all submodule.Members/IRRS.pathand.url. After them,git submodule statusand the plain clone's update exit 128 atrenamed-1.git rm --cached -- renamed-1, then the section's two lines. Typed, everything exits 0, and both members are checked out in the plain clone.-f(direction 3)(C1) (A), then a commit in
tools/x's checkout, staged in the holder, and an untracked file in it. A plaingit rm --cached -- tools/xrefuses there, exit 1.--unset-alllines, then everything as in (A).git rm --cached -f -- tools/x, with "The index stages it at a commit HEAD does not record there over a checkout, so the first line takes -f: -f takes out a staged gitlink whose checkout has moved on or holds a file git does not track, which git rm otherwise refuses, and with --cached touches no file." Typed, staged and committed, everything exits 0, and the checkout stays on disk.(C2) rv865b's (a):
git submodule add <IRSS> tools/x, not committed, with an untracked file in the checkout.--unset-alllines. Typed, thengit add .gitmodulesand a commit, the commit recorded the staged gitlink with no section. The gate then passed, and a plain clone exited 128.git rm --cached -f -- tools/x, with "HEAD records nothing there, so nothing of it is left to commit", and the closing clause "then stage .gitmodules: HEAD's holds no section of that name, so nothing of it is left to commit". Typed, then.gitmodulesstaged, nothing is left to commit (git diff --cached --quietexits 0), and the gate exits 0 in every mode.The new finding (direction 2)
(D) The state the old remedy left: (A) with the section's two lines typed, staged and committed.
family okin every mode, exit 0.git submodule statusexits 128, and so does a plain clone's update, with no member checked out.git submodule statusexits 0, and a plain clone checks out both members.git rm --cached -f -- tools/xand the-fclause. Typed and committed, everything exits 0.vendor/IRQSrecorded by hand, no section, committed;tests/test_family_bootstrap_gate_order.py): bootstrap already printed`git rm --cached -- vendor/IRQS` takes its gitlink out. The gate's--no-memberssaidfamily okthere. It now printsgitlink-unnamed, whose one line is that same line.Lines before it that write
.gitmodules(#879's C3 order, for #878's own line)These rows were measured on this branch before
_stage_firstexisted (probe-c3-now.jsonl), and then on this head (probe-c3-fix.jsonl). Every line of every finding was typed in the order printed, with nothing between, then staged and committed._stage_firstupdate = None, committed: the value finding's--unset-allline prints firstgit rm --cached -- tools/xexited 128 (please stage your changes to .gitmodules or stash them to proceed); a second roundgit add -- .gitmodulescomes before thegit rm; one round, the gate exits 0update = Nonenot stagedgit addprinted (a value finding came first); one roundtools/ywith no gitlink, earlier in the file: its--unset-alllines print firstgit rm --cached -- tools/xexited 128; a second roundgit addfirst; one round.gitmodules, not stagedgit rm --cached -- tools/xexited 128git addfirst (content differs from the index's); one roundupdate = NonecommittedUnchanged (the controls)
family.pymade it, each member undermembers/with its section and its row:family okin every mode, and a plain clone checks out both members. Before and Now alike.tools/ywith no gitlink: the same finding, the same two--unset-alllines and the same text, Before and Now. So is a section whose gitlink's removal is staged (nogit rm, which fails there).member-gitlink-unnamedfor a gitlink inmembers/keeps its texts, the hand mount's plaingit rmand the stray'sgit rm --cachedincluded. Every test oftests/test_validate_family_unnamed_mounts.py,tests/test_validate_family_remedies_typed.pyandtests/test_family_holder_bootstrap_texts.pypasses, and only one of them is changed (test_only_members_is_asked_about, under "Tests").Tests
A new file,
tests/test_family_unnamed_gitlink.py, with 17 tests. No existing file owns these states.tests/test_validate_family_unnamed_mounts.pyowns #361's two findings inmembers/. Its states are index records by design, and it pinned the very scope this changes. These need real checkouts, clones, and #876's typed helpers.tests/test_family.py'sfamilyandvalidate, andtest_family_add_refusals'holderandoffline;git rm --cached, guardedmvand section lines type as printed where they failed (#839) #876'sWORK, plustyped,staged_and_committed,assert_passes_in_every_mode,FORCED_SAIDandcase_sensitive_diskfromtest_family_head_lost_gitmodules;cloned,fetchingandtype_linefromtest_family_bootstrap_gate_order;STAGEDfromtest_validate_family_remedies_typed;SECTION_SAID,SECTION_REMEDY,findings,codes,commands,removal,stage_gitlinkandwith_sectionfromtest_validate_family_unnamed_mounts.test_a_section_s_remedy_takes_its_gitlink_out_firstfamily okin every mode,git submodule status0, a plain clone's update 0 with both members, status 0 theretest_a_gitlink_outside_members_no_section_gives_is_a_findinggitlink-unnamedwhole in every mode; typed and committed: all clean, as abovetest_a_gitlink_staged_over_a_checkout_is_taken_out_with_fgit rm --cachedexits 1;-fand its clause in every mode; typed: nothing left to commit for (C2), and committed and clean in every mode with a plain clone for the other two; the checkout still on disktest_after_lines_that_write_gitmodules_its_git_rm_stages_it_firstgit add -- .gitmodulesdirectly before thegit rm, the text whole, in every mode; every line of every finding typed in order with nothing between: clean in every mode, and a plain clone checks out both memberstest_a_gitlink_outside_members_whose_removal_is_staged_says_commit_itgitlink-unnamedwithSTAGEDand "Commit that removal.", no command; committed: cleantest_two_sections_for_one_gitlink_outside_members_print_one_git_rmgit rm, the second its own lines alone; typed: cleantest_the_holder_as_made_passes_and_a_plain_clone_checks_it_outfamily okin every mode; a plain clone checks out both memberstest_a_section_with_no_gitlink_in_the_index_prints_its_lines_aloneTwo existing tests pinned the old scope, and change:
tests/test_validate_family_unnamed_mounts.py::test_only_members_is_asked_aboutstaged gitlinks attools/IRQS,membersX/IRQSandMEMBERS/IRQSand expected one finding, forMEMBERS/IRQS. Its point stays:member-gitlink-unnamedasks onlymembers/, in any case. The two others are nowgitlink-unnamed, after it:["member-gitlink-unnamed", "gitlink-unnamed", "gitlink-unnamed"].tests/test_family_bootstrap_gate_order.py::test_a_hand_mount_outside_members_is_taken_out_of_the_index(rv648's H2) assertedvalidate(clone, "--no-members")exits 0, "premise: it reads only members/". That exit 0 is this issue. It now asserts exit 1, onegitlink-unnamedfinding, and that its one line is thegit rm --cachedbootstrap printed. The rest of the test, bootstrap's line typed and the run clean, is unchanged.Documentation tests.
tests/test_agents_md_codes.pyholds every codeAGENTS.mdnames to a tool;AGENTS.mdnames neithergitmodules-path-unnamednormember-gitlink-unnamed, sogitlink-unnamedis not added there.tests/test_cli_reference.pycomparesdocs/cli.mdwith--help.--helpand the docstring's first line are unchanged, sodocs/cli.mdis too. Both pass in the run.What it cannot tell
.gitmodulesgone, three remedies undo each other or refuse; agit mv'd checkout is never named; bootstrap saysokbeside git's exit 128 #879's C3 and C4 are the family root's validate-family.py and bootstrap.py: with the work tree's.gitmodulesgone, three remedies undo each other or refuse; agit mv'd checkout is never named; bootstrap saysokbeside git's exit 128 #879's, and are not fixed here (the coordinator's ruling):git rm --cachedofmember-gitlink-unnamed, after a value finding's lines, still exits 128. So would the hand mount's plaingit rm, by the same rule. This PR gives only validate-family.py: thegitmodules-path-unnamedremedy takes out the section of a submodule no row names and leaves its gitlink, so a plain clone'sgit submodule update --initexits 128 while the gate passes #878's two new lines thegit addfirst._second_path_outtakesstage_first, which the STRAY call does not pass, so the family root's validate-family.py and bootstrap.py: with the work tree's.gitmodulesgone, three remedies undo each other or refuse; agit mv'd checkout is never named; bootstrap saysokbeside git's exit 128 #879 can reuse it there.git mvleaves atMembers/<P>is named by nothing..gitmodulesgone, three remedies undo each other or refuse; agit mv'd checkout is never named; bootstrap saysokbeside git's exit 128 #879 to reuse:_stage_first,STAGE_LINE,STAGE_SAID,_second_path_out(stage_first=...)and_check_gitmodules_named'sedited. The C3 states are measured in this branch's probe (test_probe_c3.py, S1 to S5).git rm --cachedleaves at the path. Aftergit rm --cached -- tools/x, the checkout stays on disk, untracked, and its store under.git/modules/. The text says the line "touches no file", and nothing more about it. No later finding is made of it, andgit statusshows?? tools/..gitmodules. By bootstrap.py and validate-family.py: a.gitmodulesvalue git dies on as it reads the file failsmake bootstrapnaming the key, and the family gate names it in every mode, soupdate = Noneno longer endsfamily bootstrap ok(#768) #819's rulegitmodules-path-unnamedthen reads no section, andgitlink-unnamedpasses over a gitlink a section of that file gives. Such a gitlink is named in the next round, once the value is mended (row 5 of the table above).members/. It is the filegitmodules-path-unnamedreads, so each such gitlink is one finding, never two. A work tree with no.gitmodulesat all getsgitlink-unnamedfor every such gitlink.members/(member-path) whose case variant is a gitlink: the new finding prints itsgit rm --cachedlike any other.bootstrap.py's docstrings (cures, and step (a) of the module's) still say a gitlink outsidemembers/is one "which no mode of the validator asks about". Its printed cure is unchanged and is now the gate's, word for word. The brief keepsbootstrap.pyunchanged, and no test needed it.git mvform is skipped where the disk folds case.Choices for the reviewer
gitlink-unnamed, besidemember-gitlink-unnamed: the same question asked of a gitlink no member could be, which no row and no section names.--unset-alllines", read literally. The section's text says to commit thegit rm("and commit that"), then to commit.gitmodulesafter its own lines. The typed tests commit once at the end, which is equivalent:git rm --cachedleaves.gitmodulesalone.-ftext is the family root's bootstrap.py and validate-family.py: the credential advice and a member's exit code say what happened, and the gate'sgit rm --cached, guardedmvand section lines type as printed where they failed (#839) #876's, shared._forced_saidand_cached_removalcame out of_second_path_outwith its texts byte for byte.member-gitlink-unnamed's tests intests/test_family_holder_bootstrap_texts.pypass unchanged..gitmodulesholds no section of the name ("then stage .gitmodules: ... nothing of it is left to commit"). In (C2),then commit .gitmodulesmet nothing to commit, exit 1. The section with no gitlink (E2) keeps its old clause, which the ruling left unchanged.git add -- .gitmodulesonly where it is needed (_stage_first), so the plain states print exactly the ruled lines. It is printed after a value finding's lines or an earlier section's, and over a file whose content differs from the index's. Content, not stat:git diff-filescounts a file written in the same second as the index as changed, and the text would have varied between runs. It is never printed where the work tree has no.gitmodulesand no line before writes one, where it would stage the deletion._member_gitlinkskeeps its name though it now lists every gitlink. A rename touches every caller in a file four open PRs edit.tests/test_family_unnamed_gitlink.pybuilds its expected texts from pinned fragments.SECTION_SAIDandSECTION_REMEDYaretests/test_validate_family_unnamed_mounts.py's, so the control's text is the one that file already pins.Stacked on #876 (#839)
The DRAFT's base is
fix/839-holder-bootstrap-texts, so this PR shows only its own delta, as lane 3's #877 (#856) does.git rm --cached, guardedmvand section lines type as printed where they failed (#839) #876's restacked heada7f6c569. Lane 5 merged bootstrap.py and validate-family.py: a.gitmodulesvalue git dies on as it reads the file failsmake bootstrapnaming the key, and the family gate names it in every mode, soupdate = Noneno longer endsfamily bootstrap ok(#768) #819's squash1eff1fd0into it. The validator there is byte-identical to77f8a6c8's, so the Before lines measured on77f8a6c8stand.a7f6c569, with one commit..gitmodulesvalue git dies on as it reads the file failsmake bootstrapnaming the key, and the family gate names it in every mode, soupdate = Noneno longer endsfamily bootstrap ok(#768) #819 (landed,1eff1fd0) and the family root's bootstrap.py and validate-family.py: the credential advice and a member's exit code say what happened, and the gate'sgit rm --cached, guardedmvand section lines type as printed where they failed (#839) #876. Lane 4 restacks it after each squash.Shared files
These are
git merge-tree --write-treeof this head,c3f8fa542461091f0704e6f0732c93e5e1dd58ee. The heads were fetched from GitHub (refs/pull/<n>/headandrefs/heads/main). The open PRs are every onegh pr list --json filesshows touchingtemplates/family-root/scripts/validate-family.py(#869, #870, #876, #877), plus #865, as the brief asks.members/, a link or checkout in a move's way, an unmerged entry and a staged or unmerged.gitmodulesare named first, so each remedy types clean (#840) #865 and tests: six skips on a failed git call ask the system first, so a failed git call fails the test and an encoding that cannot spell U+202E skips the bidi test (#853, #854) #869 conflict only in files this PR never touches. This PR's basea7f6c569alone gives each of them the same conflicts, path for path. This PR's four files are none of them.members:that is not a list, or holds an entry that is not a mapping, is said in the gate's words, so the doctor'smembersrow waits on thefamilyrow instead of calling the family empty,add,bump,remove,make bootstrapandmake siblingsrefuse it by name where each ended in aTypeError, read no members or committed the entry away, and--no-membersfinds the entry (#864) #870 and bootstrap.py: a.gitmodulesblob with a line git cannot parse is read up to that line, as git reads it, and a parity test holds the value rules both family scripts write to one answer (#856) #877 merge cleanly, so no pre-resolution is needed. Both merged trees were also run, in a second clone (w878-m, merge commits never pushed):f07a3f52(this head and shape-doctor.py, family.py and the family root's bootstrap.py and validate-family.py: a holder'smembers:that is not a list, or holds an entry that is not a mapping, is said in the gate's words, so the doctor'smembersrow waits on thefamilyrow instead of calling the family empty,add,bump,remove,make bootstrapandmake siblingsrefuse it by name where each ended in aTypeError, read no members or committed the entry away, and--no-membersfinds the entry (#864) #870, treed0b132e3): the new file,tests/test_family_members_not_a_list.pyandtests/test_validate_family_unnamed_mounts.pygave213 passed in 185.21s.fb33027e(this head and bootstrap.py: a.gitmodulesblob with a line git cannot parse is read up to that line, as git reads it, and a parity test holds the value rules both family scripts write to one answer (#856) #877, treec44d2e8f): the new file andtests/test_family_gitmodules_values.pygave145 passed in 127.08s.1eff1fd0tob8ac0dba, shape-doctor.py: thelegs,manifest kindsandshape currencyrows name a pin orcontracts/this user cannot read as validate-pins.py does, with its advice and nevergit checkout HEAD --, and the verdict is INVALID, not DRIFTED (#847) #860's (shape-doctor.py: for a pin or acontracts/this user cannot read, thelegs,manifest kindsandshape currencyrows disagree with validate-pins.py's named refusal, andmanifest kindsnames agit checkout HEAD --that discards work #847) squash, which changesshape-doctor.pyand addstests/test_doctor_unreadable_pin.py, then to85555d0e, shape-doctor.py: a shape copy renamed on both sides of a merge,DDat its old name, is named gone on both sides with each new name a side's own commit holds the base's blob of it at, never as a merge of hunks git did not merge (#783) #789's (shape-doctor.pypin_restore: a shape copy renamed on BOTH sides of a merge leavesDD/AU/UA, and the doctor names neither new path and tells a person to keep "the hunks git merged" where there are none #783) squash, which changesshape-doctor.pyandtests/test_doctor_pin_restore_merges.py. Neither changes any of this PR's files, and this head merges cleanly with each.Pinned copies
templates/family-root/scripts/validate-family.pyis inshape_materialize.FAMILY_COPIED_VERBATIM(scripts/shape_materialize.py:528), so a holder takes it as oneupstream-changedrow.bootstrap.pyandsiblings.pyare unchanged. No digest of the file is held in this repository:git grepfinds neither value on this head.a7f6c569templates/family-root/scripts/validate-family.py(pinned)b85c953e0255e96ac10769e1e973492cc317f6dd2f276376e023bbf6f8421c81b1e521891673dee6aaa86e732a3c29d70fb647dcb1201f17b7bf984bede39402What a holder sees. A holder was cut from
a7f6c569(family.py init, offline).update-shape.py check --upstream <this checkout> --at c3f8fa542461printed:Mutants
Each was put in, one at a time. The new file and the two changed tests were run against it (19 tests), and the bytes were restored afterwards and checked by sha256 (
265a2b4e...). Those bytes are this head's but for one docstring sentence, which was reworded after the mutant runs: the two files' ASTs, docstrings stripped, are equal.gitmodules-path-unnamedprints nogit rm --cached-fcases, two of thegit addcases, the two-sections test-fand its clause dropped (both new sites)-fcasesgitlink-unnameddroppedtest_only_members_is_asked_about_member_gitlinks's scope put back tomembers/git rmprinted by every section that gives the pathgit rmprinted over a staged removalgit add -- .gitmodulesnever printedgit addcasesThe kill lists are in
w878/logs/mutants-killers.txt.The run
One background run on this head's bytes (the four files' sha256 are recorded at the top of the log, and equal
git show HEAD:<path>), 29 files:GIT_CONFIG_GLOBALan empty file,GIT_CONFIG_NOSYSTEM=1andGIT_ALLOW_PROTOCOLunset;ghthat exits 97 first on PATH,GH_TOKEN=bogusand an emptyGH_CONFIG_DIR;GIT_SSH_COMMAND=false.1430 passed, 18 skipped in 1142.69s (0:19:02), exit 0, ending at 07:37:32Z. The 18 skips:git filter-repo;tests/test_no_auto_maintenance.py, since the run setGIT_CONFIG_GLOBAL.tests/test_agents_md_codes.py,tests/test_branch_left_bump_leg_setup.py,tests/test_cli_reference.py,tests/test_doctor_legs_members_next.py,tests/test_doctor_validator_rows.py,tests/test_family.py,tests/test_family_add_member_variant.py,tests/test_family_add_refusals.py,tests/test_family_add_spellings_remedies.py,tests/test_family_bootstrap_gate_order.py,tests/test_family_gitmodules_values.py,tests/test_family_head_lost_gitmodules.py,tests/test_family_holder_bootstrap_texts.py,tests/test_family_member_path.py,tests/test_family_remove_gitmodules.py,tests/test_family_switch_branch_exists.py,tests/test_family_unnamed_gitlink.py,tests/test_no_auto_maintenance.py,tests/test_pinned_copy_text.py,tests/test_refusal_default_remediation.py,tests/test_repo_hygiene.py,tests/test_template_text_placeholders.py,tests/test_validate_family_branch_step.py,tests/test_validate_family_duplicates.py,tests/test_validate_family_member_path_glob.py,tests/test_validate_family_remedies_typed.py,tests/test_validate_family_typed_states.py,tests/test_validate_family_unnamed_mounts.py,tests/test_validate_family_without_git.py.git grep -l -e validate-family -e gitmodules-path-unnamed -e member-gitlink-unnamed tests/lists on the base. They testfamily.py's other verbs,update-shape.py, the doctor's other rows, the leg validator and the pinned copy's bytes, and none builds a gitlink outsidemembers/.tests/test_family_docs_one_spelling.pyreadsRESTORE_ROWandmember-gitlink-absent's remedy, which this PR does not change.tests/test_doctor_gitlink_repairs.py,tests/test_doctor_next_is_a_command.py,tests/test_family_add_excludes.py,tests/test_family_add_member_id.py,tests/test_family_add_move_back_sections.py,tests/test_family_bump_remove_rollback.py,tests/test_family_bump_to_a_tag.py,tests/test_family_bump_to_checks.py,tests/test_family_bump_to_local_only.py,tests/test_family_docs_one_spelling.py,tests/test_family_dry_run.py,tests/test_family_init_values.py,tests/test_family_makefile_siblings.py,tests/test_family_member_name.py,tests/test_shape_doctor.py,tests/test_shape_pin_files_not_a_list.py,tests/test_shape_pin_row_path.py,tests/test_siblings_inputs.py,tests/test_stdout_encoding.py,tests/test_template_values_single_pass.py,tests/test_update_shape.py,tests/test_update_shape_add.py,tests/test_update_shape_header_comments.py,tests/test_update_shape_kept_helper.py,tests/test_update_shape_pr_base.py,tests/test_validate_pins_without_git.py.members:that is not a list, or holds an entry that is not a mapping, is said in the gate's words, so the doctor'smembersrow waits on thefamilyrow instead of calling the family empty,add,bump,remove,make bootstrapandmake siblingsrefuse it by name where each ended in aTypeError, read no members or committed the entry away, and--no-membersfinds the entry (#864) #870 and bootstrap.py: a.gitmodulesblob with a line git cannot parse is read up to that line, as git reads it, and a parity test holds the value rules both family scripts write to one answer (#856) #877 gave 213 and 145 passed (see "Shared files").Closes #878
🤖 Generated with Claude Code
Summary by Sourcery
Ensure validation remedies remove or correctly stage unnamed gitlinks outside
members/so clean clones can initialize all members successfully.New Features:
members/so they cannot break submodule initialization in plain clones..gitmodulessections..gitmoduleshas unstaged changes or checkouts require-f.Bug Fixes:
git submodule update --initandgit submodule statusto fail.Enhancements:
member-gitlink-unnamedbehavior while validating gitlinks throughout the repository.Tests:
gitlink-unnamedfindings for gitlinks outsidemembers/.