Skip to content

adopt-project.py execute exits 2 with nothing on stderr when git filter-repo fails, after both leg remotes exist: _build_the_legs swallows CommandFailed on the premise that run already reported it, and run only raises #171

Closed

Description

@brettheap

(lane openRepoShape-2, 2026-10-09T02:08:54Z) Found by the re-verification of the #166 branch at 09d7889; pre-existing on main 7f84ca4 and outside #166's scope. Not claimed.

What is wrong. _build_the_legs catches CommandFailed from the leg extraction and returns None (adopt-project.py:1652-1653 at 09d7889; the same except CommandFailed: return None on main). Its docstring says run has already said which command failed and why, but run (scripts/shape_materialize.py:474-481) only raises. cmd_execute then returns 2. The human sees the two bare .../Northwind-spec.git / Northwind-code.git lines on stdout, exit 2, and an EMPTY stderr. Both leg remotes exist afterwards, so a re-run meets leg-remote-exists.

Reproduction (any source whose .gitmodules git's --list accepts but whose checkout git's submodule reader dies on; on main an unterminated section does it, and on 09d7889 a bare path key in a second section):

printf '[submodule "a"]\n\tpath = upstream/dependency\n\turl = %s\n[submodule "b"]\n\tpath\n' "$DEP" > Thing/.gitmodules   # plus the gitlink at upstream/dependency
adopt-project.py plan --source Thing --project Northwind ... ; resolve .gitmodules and upstream/ to code
adopt-project.py check --plan plan.yaml                         # exit 0 at 09d7889
adopt-project.py execute --plan plan.yaml --yes --local-remote-dir remotes --work-dir work > out 2> err; echo $?   # 2
wc -c err                                                       # 0
ls remotes                                                      # Northwind-code.git  Northwind-spec.git

With CommandFailed instrumented, the swallowed failure is git filter-repo --paths-from-file .../spec-paths.txt --force with stderr error: missing value for 'submodule.b.path' / fatal: bad config line 5 in file .../Northwind-spec/.gitmodules / Error: fast-export failed. A symlinked .gitmodules with everything dropped reaches the same silent exit on both trees.

What would fix it. Print the failure (exc.loudly(...), or whatever run's callers use elsewhere) before returning None, naming the command and its stderr, so an execute that stops after creating the legs says why. Independent of #166, #165, #167 and #168; a one-hunk change in _build_the_legs plus a test that asserts stderr names git filter-repo when it fails.

Driver and probe: opensoft/brett-wip handoffs/xFactory/attachments/lane-openRepoShape-2/review166-09d7889/ (r3-report.md N4, r3tools/runexec2.py).

Activity

  1. brettheap commented on Oct 9, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-1, session f711ec94-a922-4e5f-8d35-efcfe983caa7@Eagle, 2026-10-09T02:59:23Z, for #171

    Logged in lanes/log/openRepoShape-1.md at 5a330fe8d135135eafb82e3495b33b78f7c552ce.

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

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions