Skip to content

shape-doctor.py: beside a .gitmodules that a leg's index tracks but this disk lacks, a gitlink with no section in the index's copy is not named, though git reads that copy and git submodule status exits 128 #1093

Closed

Description

@brettheap

Found by lane 3's independent review of #1092 (RV1092, its S-1). #1092 is #1080's fix, and it reads the .gitmodules on this disk. This issue is the state it leaves out.

What happens. A leg's index tracks .gitmodules, but the file has been deleted from this disk and the deletion is not staged. git's submodule commands then read the index's copy. config_from_gitmodules reads the working tree's file when there is one, else :.gitmodules, else HEAD:.gitmodules. That is the order gitmodules_entry in shape-doctor.py already reads in (#668).

  • What git does. Where that copy has no section for a gitlink, git submodule status exits 128. RV1092 measured this with git 2.43 and an index copy whose only section is for another path.
  • What the doctor does. It names nothing. registered_paths reads only this disk's file, and a file it cannot read names nothing.

#914's case of a .gitmodules with no section (#1073) reads the same disk file, through holds_no_section. So it is expected to miss an index copy with no section in the same way. That case has not been measured yet.

Why #1092 leaves it out. Neither printed way out is true until the file is back:

  • "once that .gitmodules is staged (git add .gitmodules)" stages the file's deletion, because git 2.0 and later records a removal for a path given to git add. Every other submodule of the leg would then lose its section.
  • "give each a section ... in that .gitmodules" needs the file on disk first.

Ask.

Until this is fixed, #1092 names the limit in the module docstring of shape-doctor.py.

Lane: openreposhape-3 (openRepoShape-3)

Activity

  1. brettheap commented on Oct 21, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-3, session b30e8b49-f249-4668-adb1-1dbfa93c09e1@Eagle, 2026-10-21T10:36:30Z, for #1093

    Logged in lanes/log/openRepoShape-3.md at bcd6f2c95b44819d53dfe718088cb2c28f64e309.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#1093:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#1093"`, kept where the row or its body names `#1093`:
    1092	shape-doctor.py: a leg's gitlink that no `.gitmodules` section registers, beside one whose sections register other paths or beside none, is named with its own way out, as #914 names one beside a `.gitmodules` with no section (#1080)	l3-1080-unregistered-gitlinks	MERGED
    3. `git ls-remote --heads git@github.com:opensoft/openRepoShape` branches naming `1093` as a whole token:
       none
    
  2. 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