Skip to content

adopt-project.py: plan --source of a repository whose .git is at mode 000 is refused git-failed with no name for the .git, and a clone whose .git/HEAD or whose gitdir: target is at mode 000 is called no longer whole and cloned again, where #1141 refuses a recorded clone's unreadable .git by name (see #1099) #1151

Open

Description

@brettheap

(lane openRepoShape-4, 2026-10-22T12:26:09Z)

These are three cases W1099 measured that #1141 (the PR for #1099) leaves as they are: see #1141 and see #1099. #1141 makes a recorded source whose .git this user cannot read a source-unreadable refusal that names that .git. It leaves the three below. Measured as uid 1000 with git 2.43, on main 4ed7c7bf5, in adopt-project.py.

  1. plan --source or check --source of a repository whose .git is at mode 000 still refuses git-failed ... not a git repository, exit 2, and the refusal does not name the .git.

  2. A readable .git directory with its HEAD at mode 000 (cloned: true) is still called no longer whole and cloned again, with one gh call.

  3. A readable .git file whose git directory is at mode 000 (cloned: true) is the same: called no longer whole and cloned again, with one gh call.

    • Fix: follow the gitdir: line and refuse an unreadable git directory, naming it.

Cases 2 and 3 are the behaviour #1099 describes for a recorded clone whose .git cannot be read: see #1099. They differ in which part of the repository is unreadable, and #1141 handles only the .git itself, for a recorded clone. Case 1 is the same unreadable .git reached through --source instead of a recorded clone.

Lane: openreposhape-4 (openRepoShape-4)

Activity

  1. brettheap commented on Oct 22, 2026

    @brettheap
    ContributorAuthor

    (lane openRepoShape-4, 2026-10-22T15:24:15Z)

    These are more cases for the three above, from RV1141's review of #1141 (#1141 issuecomment-6342327481), NIT-2 and NIT-3. Each behaves exactly as it does on main, and #1141 makes none of them worse: see #1141 and see #1099. RV1141 measured them with check and cloned: true, as uid 1000 with git 2.43.0, on main 038dafba9 (adopt-project.py is byte-identical on it and on 4ed7c7bf5); git's own words below were measured again here.

    In each, a clone plan made is still called "no longer whole (git finds no repository there)" and cloned again from GitHub, with one gh call. _not_a_whole_clone (about :2601 at 038dafba9) takes any failure of git rev-parse --show-toplevel as "git finds no repository there", and _recorded_source (about :6610, the state worded at about :6702) then clones source.repository.

    1. objects/, refs/ or config inside a readable .git directory at mode 000 (cloned: true). Case 2 names HEAD only.

      • For objects/ and refs/ git says "fatal: not a git repository (or any of the parent directories): .git", as it does for HEAD. For config it says "fatal: unable to access '.git/config': Permission denied".
      • Fix: refuse these too, naming the one that is refused. Git's own test that a directory is a git directory asks HEAD, objects/ and refs/; config is asked on its own.
    2. A worktree's gitdir, or the common .git above it, at mode 000 (cloned: true). The worktree's .git is a file naming <common>/.git/worktrees/<name>. For either, git says "fatal: not a git repository: ". With cloned: false the answer is git-failed, as on main.

      • The gitdir at 000 is case 3. The common .git at 000 is the directory above case 3's git directory, so the refusal must name the directory that is refused, which is not always the one the gitdir: line names.
    3. A submodule's .git/modules/<m> at mode 000 (cloned: true). The submodule's .git is a file naming ../.git/modules/<m> in its superproject. Git gives the same "fatal: not a git repository: ", and cloned: false is git-failed, as on main. It is case 3's shape for a submodule.

    4. A .git that is a symlink whose target's parent is at mode 000 (cloned: true). Git says "fatal: not a git repository (or any of the parent directories): .git".

    Lane: openreposhape-4 (openRepoShape-4)

  2. brettheap commented on Oct 22, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-3, session b30e8b49-f249-4668-adb1-1dbfa93c09e1@Eagle, 2026-10-22T19:41:59Z, for #1151

    Logged in lanes/log/openRepoShape-3.md at 50f4c84050e52023043623d493b8293c5f2c2044.

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

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