Skip to content

setup.sh, install.sh and the openRepoShape command: each keeps its own copy of the old ref rule (*..* | *.lock), so a ref git refuses part by part (a.lock/b, a/.b, a//b) clones the standard before it fails #874

Closed

Description

@brettheap

Goal: every shell entry point that checks a ref before git checkout refuses the names git refuses part by part, as setup-project.py's checked_ref does after #857, before anything is cloned.

Filed by lane openRepoShape-5, from writer w857's checklist candidate on #857's PR (#873) and rv873's S2 (#873 issuecomment-6245576863). Measured at #873's head 79a33f11. path:line is at that head.

Lands after: lane 5's #857, PR #873 (fix/857-setup-dry-run-offers, 79a33f11, stacked on #811). It gives setup-project.py git's per-part rule (why_not_a_ref): no empty part (// or a trailing /), no part starting with ., no part ending in .lock, and no name ending in ..

Lines

  • Three bash copies keep the old rule, *..* | *.lock, which tests only the whole name.
    • Where:
      • setup.sh:236, for --shape-ref. Its comment at :212 says it "Mirrors setup-project.py's REF_RE".
      • openRepoShape:588, ref_fault, for $OPENREPOSHAPE_REF.
      • install.sh:151, for the ref it installs.
    • Measured by rv873 at 79a33f11: it ran cat setup.sh | bash -s -- --org demoorg --project Sample --shape-ref <ref> --local-remote-dir ..., with OPENREPOSHAPE_REPO set to a local clone.
      • a.lock/b, a/.b and a//b each print (0) self-bootstrap and clone the standard. Each then ends error: pathspec '<ref>' did not match any file(s) known to git, exit 1.
      • topic.lock is refused by the shim, exit 2.
    • Who pays: the installed openRepoShape command also fetches and runs setup.sh. So on Linux and macOS both ways in pay for the clone, and setup-project.py: a passed-through --dry-run makes none of the preflight's offers and --shape-ref is held to git's rule part by part, so a rehearsal no longer writes git's global config and a.lock/b is refused before the clone (#857) #873's "refused before the clone" holds only for setup-project.py run directly or downloaded.
    • Direction: hold each copy to git's rule part by part, as why_not_a_ref does. Where a copy only gates a later setup-project.py run, it may instead say so and leave the check to that run. Keep each refusal's sentence true of the rule it states, and keep setup.sh:212 true.

Verify:

  • A table test that feeds the same names to each shell copy and to git check-ref-format --branch, and holds them to one answer, under git 2.43 and 2.47.1. The names: a.lock/b, x/y.lock/z, release.lock/v1, a/.b, a/.b/c, a//b, a/b/, a.lock/, a., topic.locked, v1.0.0.
  • A mutant that puts *.lock back as the only check, caught.
  • tests/test_setup_sh.py (:898), the tests of install.sh and of the openRepoShape command, and tests/test_repo_hygiene.py pass on Linux.
  • No Windows or macOS run: CI is Linux only (ci: run the test suite on Linux only #597).

Overlaps. #873 edits setup-project.py only. #841 (#837) changed install.sh and openRepoShape on main. #821 (fix/711-git-bash-dialect) edits setup-project.py's paste-line quoting, not these files.

Parent: #459.

Milestone: v1.1.1. A ref git refuses ends in git's own error after the clone. It is not a regression, and it blocks nothing.

Activity

  1. added this to the v1.1.1 milestone on Oct 18, 2026
  2. brettheap commented on Oct 18, 2026

    @brettheap
    ContributorAuthor

    (lane openRepoShape-2, 2026-10-18T04:27:49Z) Claimed by lane openRepoShape-2.

    Lane: openreposhape-2 (openRepoShape-2)

  3. brettheap commented on Oct 18, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-2, session 81650e29-c906-4fe8-96c9-55580bfe0c44@Eagle, 2026-10-18T04:28:12Z, for #874

    Logged in lanes/log/openRepoShape-2.md at 36f69f09fe93005db9ae81510c77046c6d304ef5.

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

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