Skip to content

adopt-project.py check accepts a .gitmodules value git's submodule reader rejects (update = bogus, update =, update = !cmd, shallow = maybe, fetchRecurseSubmodules = bogus), so plan ok is followed by execute dying in git filter-repo after both leg remotes exist, whether the tip or only the history holds the gitlink #215

Closed

Description

@brettheap

Lane: openreposhape-3 (openRepoShape-3)

Found by this lane's work on #195 (branch fix/adopt-history-gitlinks); pre-existing on main 20e13f0, and e4decfb behaves the same. #195 covers a key with NO value (path, url, update and the rest with nothing after them). This is the other class its branch leaves out: a key WITH a value that git's submodule reader refuses.

What is wrong. When git reads a .gitmodules for a gitlink, its submodule reader (submodule-config.c) checks the type of a few values and dies on one it refuses. git filter-repo runs git fast-export, which reads the checked-out .gitmodules for every gitlink in the history it exports, not only the tip's (#195). _registrations (adopt-project.py:340) and Source.registered_submodules (:418) mirror the filters that decide what a path or url registers, and the key with no value. They check no value's type. git config --list accepts all five files below (exit 0), so check says plan ok, and execute fails inside the extraction after both leg remotes exist; the corrected re-run then meets leg-remote-exists.

Measured on main 20e13f0 with git 2.43.0. The source's .gitmodules is [submodule "b"] with path = vendor/b, url = ../b and one more line; the plan answers .gitmodules and vendor/ as code. TIP: the tip holds the gitlink vendor/b. HISTORY: only an earlier commit did, and the tip removed it and kept the .gitmodules.

extra line                       git fast-export --all                                              TIP                HISTORY
update = bogus                   rc 128 fatal: invalid value for 'submodule.b.update'               check 0 / exec 2   check 0 / exec 2
update =                         rc 128 fatal: invalid value for 'submodule.b.update'               check 0 / exec 2   check 0 / exec 2
update = !cmd                    rc 128 fatal: invalid value for 'submodule.b.update'               check 0 / exec 2   check 0 / exec 2
shallow = maybe                  rc 128 fatal: bad boolean config value 'maybe' for                 check 0 / exec 2   check 0 / exec 2
                                        'submodule.b.shallow'
fetchRecurseSubmodules = bogus   rc 128 fatal: bad submodule.b.fetchrecursesubmodules argument:     check 0 / exec 2   check 0 / exec 2
                                        bogus
ignore = bogus                   rc 0, only `warning: Invalid parameter 'bogus' for config option`  check 0 / exec 0   check 0 / exec 0
branch =                         rc 0                                                               check 0 / exec 0   check 0 / exec 0

Every exec 2 leaves Northwind-code.git and Northwind-spec.git behind; every exec 0 ends adoption verified. At bf65ae4, the head of the #195 branch when this was filed, the no-value class (a bare path, a bare update) is a plan-gitmodules-unreadable FINDING and execute refuses before any leg exists, and the five value cases above still check 0 and exec 2 in both positions.

The failing case, step by step (TIP, update = bogus):

adopt-project.py check --plan plan.yaml                  # exit 0, last stdout line `plan ok`, stderr empty
adopt-project.py execute --plan plan.yaml --yes --local-remote-dir remotes --work-dir work > out 2> err; echo $?
# 2
wc -c err                                                # 0   (the empty stderr is #171)
ls remotes                                               # Northwind-code.git  Northwind-spec.git
adopt-project.py execute --plan plan.yaml --yes --local-remote-dir remotes --work-dir work2
# REFUSED leg-remote-exists: .../remotes/Northwind-spec.git already exists
cd work/Northwind-spec && git filter-repo --paths-from-file ../spec-paths.txt --force
# fatal: invalid value for 'submodule.b.update'
# Parsed 1 commits
# Error: fast-export failed; see above.
# fatal: stream ends early

What would fix it. Either of two, and the first needs no list of git's keys to keep current.

  1. Ask git's own reader. In a scratch repository, write the blob as .gitmodules, add a synthetic gitlink at a path the file registers (git update-index --add --cacheinfo 160000,<sha>,<path>) and run git submodule status. Measured on the same five files, it exits 128 with git's own sentence each time, and exits 0 for ignore = bogus (a warning) and branch =, which git accepts. git config --file .gitmodules --list exits 0 for all of them, and git config --type=bool catches only shallow.
  2. Mirror the three parsers in _registrations: parse_submodule_update_strategy for update (which also refuses !cmd in a .gitmodules), parse_fetch_recurse for fetchRecurseSubmodules, and the boolean reader for shallow. That list then has to follow git.

Either way check reports a FINDING that names the key and git's text, and execute refuses it through #168's shared findings list before any leg exists, in the TIP and the HISTORY position alike, using the history test #195's branch adds. A test per row of the table.

Not claimed.

Activity

  1. brettheap commented on Oct 11, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-3, session 566fec94-6fde-4579-947f-ec4fda5ce14f@Eagle, 2026-10-11T16:25:17Z, for #215

    Logged in lanes/log/openRepoShape-3.md at 34c6144adf0b415616fa63f96b6bb433e519dae2.

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

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions