Skip to content

adopt-project.py: with clone.defaultRemoteName in the global git config, execute ends REFUSED mounting the legs ("No such remote 'origin'") after both legs are pushed, as it names its clones' remote origin (RV1251's NIT-1 on #1251; follows #1247) #1261

Closed

Description

@brettheap

(lane openRepoShape-4, 2026-11-08T16:02:02Z)

Found by: RV1251, lane 4's independent review of PR #1251 (a draft for #1247) at 825923c7, in its report and in its review comment (#1251 (comment)), finding NIT-1. The review graded #1251 NOT READY on a SHOULD that is not this. NIT-1 is older than #1251, since main has it, and RV1251 asked for a follow-up: "Follow-up issue: _extract_leg could clone with --origin origin, and the mount's git remote set-url origin, which fails on main, needs its own answer." This is that issue. It follows #1247 and #1251. The report is a lane 4 reviewer's message and is not posted on GitHub.

Lane 3 places this issue, and it has no milestone here. It is about how execute meets a user's own git settings, which no gate sets, and on a different path from the one #1247 and #1251 change.

The measurements below are RV1251's (git 2.43.0, Python 3.12.3, git-filter-repo 2.47.0), and nothing was re-run for this issue. RV1251's main was 11560eb9. Line numbers are at origin/main 5926cccab, read from that commit and not run. This body is ASCII.

What is missing

A user can see it: with clone.defaultRemoteName set in the global git config (RV1251 measured upstream), adopt-project.py execute ends in REFUSED mounting the legs, exit 2, after both legs are made and pushed. The lane's gates run with an empty global git config (RV1251's: GIT_CONFIG_GLOBAL an empty file), and the only mention of the key in the repository is tests/test_clone_just_pushed.py (:84 to :99, a test of a test helper), so no row runs execute under it and no gate is known to see it.

What was measured, and by whom

Measured by RV1251, on main 11560eb9. The global git config held

[clone]
	defaultRemoteName = upstream

For a standard source (a directory Thing, project Northwind), plan and check exit 0, and execute --local-remote-dir exits 2. This is execute's own output as it stands in the probe (paths shortened to ...):

creating the leg repositories
  bare  .../remotes/Northwind-spec.git
  bare  .../remotes/Northwind-code.git
  spec    5 path(s) -> cc7864f3878b (3 commits kept) -> .../remotes/Northwind-spec.git
  code    5 path(s) -> 3ba389904047 (2 commits kept) -> .../remotes/Northwind-code.git

REFUSED mounting the legs. THE EXACT COMMAND WAS:
    git remote set-url origin .../remotes/Northwind-spec.git
    (in .../work/Northwind/spec)
    exit 2
--- output ---
error: No such remote 'origin'
--- end output ---
NOTHING has been rolled back: ... both legs are pushed.

The probe is RV1251's, in lane 4's scratch (tools/run/rv1251/probes/d-maincur/; the config is cfg/defremote.gitconfig). It is one source, one value of the setting (upstream) and one git.

Measured by RV1251, on #1251's head 825923c7, with the same setting. execute ends earlier, in REFUSED extracting the spec leg, with git config --unset remote.origin.url at exit 5 and an empty output block, before anything is pushed. The work clone holds remote.upstream.url, branch.main.remote=upstream and refs/remotes/upstream/*, and no remote.origin.url to unset. RV1251: "The outcome is not worse, but the new refusal names no cause."

#1251's fix round is not this issue's. F1251, the fix round on #1251, was under way when this was filed. Its brief asks that, where the missing key can happen with this setting, the unset carry on silently on exit 5 and on no other exit, so that #1251's head fails no earlier and no worse than main does, and it tells F1251 not to fix clone.defaultRemoteName itself. Its result is not in this issue. If it does that, execute with the setting would fail where main fails, at the mount, and that failure is this issue.

What this issue's filer read on main (not run)

Candidate fixes (RV1251's first; none tried)

  1. Clone with --origin origin in _extract_leg (RV1251's). It does not reach the mount: RV1251 says the mount's git remote set-url origin "needs its own answer".
  2. The filer's notes, not RV1251's: give every clone execute makes -c clone.defaultRemoteName=origin, or ask each clone for the name of its remote and not assume origin. Whether the first reaches the clone that git submodule add makes is not known.

Which one, or another, is lane 3's call.

Not known: whether anything after the mount (the commit of the split, the push, the verification) also names origin, since the run stops at the mount; whether setup-project.py, scaffold-project.py, family.py, update-shape.py or bump-leg.py meet the same setting, since RV1251 probed adopt-project.py only; another value of the setting, another git, or Windows.

Done when

  • A row gives execute a global git config (GIT_CONFIG_GLOBAL naming a file that holds [clone] and defaultRemoteName = upstream) and a standard source with --local-remote-dir. execute exits 0 and says adoption verified. The row fails on main with REFUSED mounting the legs and passes with the change, and a mutant that drops the change fails it.
  • The legs it pushes are byte-identical to those of a run without the setting. RV1251's rvprobe.py (tools/run/rv1251/) dumps every ref, object, commit, tree and tag for that comparison.
  • The row sets the variable for its own child only. The rows that run under an empty global git config keep their outcomes.

See #1247 and #1251.

Lane: openreposhape-4 (openRepoShape-4)

Activity

  1. added this to the v1.2.1 milestone on Nov 8, 2026
  2. brettheap commented on Nov 8, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-3, session b30e8b49-f249-4668-adb1-1dbfa93c09e1@Eagle, 2026-11-08T16:11:22Z, for #1261

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

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

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