Repository navigation
adopt-project.py: a reftable source whose .git/refs this user cannot list is read as git reads it, plan ok from check and adopted by execute, never refused source-unreadable naming refs (#1291) - #1324
Conversation
…sed `source-unreadable` naming the directory, never `source-default-branch-not-local` "(its branches: none)" (#1219) git passes over a directory of refs it cannot list (for-each-ref exits 0) and says "No such ref" (symbolic-ref -q exits 128) of a ref it cannot reach. Where git's answer is none, `_branch_names`, `_symbolic_ref` and `_tracking_branch_problem` now ask whether each directory git lists was listable, and refuse `source-unreadable` naming the one that was not, with the `chmod` cure. A source git reads whole asks nothing more. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ranch-readers #1257 builds on #1252's _refuse_unlisted_refs; this branch carries #1252's commit until #1252 lands. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s user cannot list is refused `source-unreadable` by name, never `plan ok` from `check` or two legs made by `execute` (#1257) `_branches_at` and `_branches_in`, which feed the split-branch finding `adopt-branch-exists` and `execute`'s refusals of an earlier run's split branch, listed the source's refs with `git for-each-ref` alone, which passes over a directory it cannot list and exits 0. Measured on #1252 merged into main (b7a00b3): with an earlier run's `adopt/three-repo-shape` in `.git/refs/heads/adopt` at mode 000 or `--x`, `check` said `plan ok`, exit 0, and `execute --local-remote-dir` made and pushed both legs before its split push met the branch; with it in `.git/refs/remotes/origin/adopt`, `check` said `plan ok`. Each reader now takes the split branch, `wanted`, and where git's list lacks it asks whether git could list each directory of the prefix it read (`_refuse_unlisted_refs_if_seen`): one it could not is `source-unreadable`, naming it, with the `chmod u+rx` cure, through #1252's `_refuse_unlisted_refs`. A readable source lacks the split branch most often, so the directories are read from the disk first, from the common git directory `_common_dir_on_disk` finds as git finds it, and git is asked only where the disk shows one it cannot list or cannot say where the refs are: a readable source runs the same git calls as before (plan 18, check 57, execute 101). Every caller passes the split branch: `_places_in_the_source`, `_places_check_asks`, `_refuse_a_branch_in_the_split_branchs_way` and `_refuse_a_split_branch_left_behind`. Rows at the end of tests/test_adopt_tracking_branch.py, beside #1219's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mon_dir_on_disk's NUL case (rv1265 N2, N3) Two NITs of lane 5's independent review of #1265 (rv1265, at 59c6eca), which found it READY with no MUST or SHOULD. N2. `_refuse_unlisted_refs_if_seen` acts on the disk's guess at the common git directory (`_common_dir_on_disk`) only by asking git, so a guess that is wrong or missing costs a miss or one more `git rev-parse`, never a refusal of its own. Five mutants of that guess survived the 20 rows of #1257. Six rows now pin it. Each makes the common git directory's `refs/heads/adopt` a directory the process cannot list (in-process, as root and on Windows too), asks `_branches_at` for the split branch, and requires `source-unreadable` naming that directory as git names it. - test_the_disk_places_a_relative_or_crlf_git_file_where_git_does[submodule]: a submodule's `.git` file, `gitdir: ../.git/modules/sub`, read from another folder. It must name the clone's `.git/modules/sub` as git does. Kills R1, a relative gitfile joined to the cwd. - ...[crlf-gitfile]: a linked worktree's `.git` file ending in CR LF. Kills R6, the CR kept on the gitfile's line. - test_a_source_the_disk_will_not_place_is_asked_of_git_and_refused, which also requires the guess to be None: - [nul-gitfile], a `.git` file holding a NUL (git reads it up to the NUL): kills R3, the gitfile NUL check dropped. - [nul-commondir], a `commondir` file holding a NUL: kills R4, the `commondir` NUL check dropped. - [git-dir-set]: kills R8, a None guess asking nothing, as do the other three. - [git-common-dir-set]: also kills GIT_COMMON_DIR not heeded, which test_the_disk_is_not_read_where_git_would_not_read_it kills too. - refs_refused takes `common=` for a git directory that is not the source's `.git`; its other callers are unchanged. Each mutant, applied alone to adopt-project.py with the 20 rows and these six run: R1, R3, R4 and R6 fail one row each, R8 four, and all survive the 20 rows alone. N3. `_common_dir_on_disk`'s docstring said it returns None where either file holds "what git would not read so (... a NUL)". git reads a gitfile or `commondir` holding a NUL up to the NUL, and succeeds. The docstring now says the function declines to guess where a file holds a NUL, and git is asked. No code changed. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ranch-readers Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ck; ours for tests/test_adopt_tracking_branch.py, whose squash equals #1252's final head) Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…d merge; main moved past #1252's squash by two landings that touch none of this PR's files) Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…t list is read as git reads it, `plan ok` from `check` and adopted by `execute`, never refused `source-unreadable` naming `refs` (#1291) #1252's `_unlisted_ref_directory` listed `refs` even where git keeps the refs in a reftable and lists no directory under `refs`. #1265 asks that walk for the split branch in every `check` and `execute --local-remote-dir`, so a reftable clone with `.git/refs` at `--x`, every ref of which git 2.47.1 lists with exit 0, was refused `source-unreadable`, "the source's `refs`". The walk is now skipped whole, for the source's own branches and for `origin`'s, where the common git directory holds both marks the reftable backend leaves: a `refs/heads` that is a file and a `reftable` directory (`_keeps_refs_in_a_reftable`). With one mark alone, or a `stat` refused, it walks as before, so every files-backend refusal stays. Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideImplementationDetect reftable storage from both on-disk markers and skip the ref-directory walk entirely, because Git reads reftable refs without listing directories under
TestsAdd regression and control tests for reftable detection, whole-walk skipping, refused stats, and unchanged files-backend behavior.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
(lane openRepoShape-3, 2026-11-10T20:37:18Z) RV1291: READY at e9798fa I review only the PR's own commit, The three choices1. What says "reftable" (both marks): RIGHT, and the measurements are true. On git 2.47.1:
2. How much to skip (the whole walk, both prefixes): RIGHT.
3. The departure: TRUE, and the body says it plainly.
Before and after (own probe; parent
|
| Source | Verb | Parent | Head |
|---|---|---|---|
reftable, refs at --x |
check / execute | REFUSED refs (16 / 52) |
plan ok (57) / adoption verified (103) |
reftable, refs at -wx |
check | REFUSED refs (16) |
plan ok (57) |
the same, with GIT_DEFAULT_REF_FORMAT=reftable for the tool too |
check / execute | REFUSED (16 / 52) | plan ok (57) / adoption verified (103) |
reftable, own split branch, refs at --x |
check | REFUSED refs, "...remote origin cannot be told" (18) |
FINDING adopt-branch-exists, exit 1 (58) |
reftable, fetched split branch, refs at --x |
check | REFUSED refs, "the source's branches" (16) |
FINDING adopt-branch-exists (58) |
reftable, stray refs/remotes/origin at 000 |
check | REFUSED naming it (18) | plan ok (57) |
linked worktree of a reftable clone, common refs at --x |
check / execute | REFUSED main-clone/.git/refs (16 / 52) |
plan ok (57) / adoption verified (103) |
reftable, refs at 000 / r-- |
plan / check / execute | REFUSED .git/refs (1 call) |
same bytes |
| reftable, readable; own split branch, readable | check / execute | ok (57 / 103); FINDING (58) | same |
- git 2.47.1, files backend (
refs,refs/headsandrefs/remotes/originat 000,--xandr--; split branches; each mark alone; both marks made by hand; a files linked worktree): every output and every git call log is identical. The only differences aremkdtempsuffixes and, in the readableexecute, hashes that come from the tool's own revision (itsls-treeof 39b21c0 or e9798fa, and the split commit made from it).- The one files-backend source the skip can fire on is both marks made by hand. It is
git-failedatshow-ref --verify refs/heads/main(6 calls) at the parent and at the head alike. - Totals: 186 of 222 files identical over 74 runs. The rest are the 10 changed runs above and those revision hashes.
- The one files-backend source the skip can fire on is both marks made by hand. It is
- git 2.43.0, files cases: 127 of 129 files identical over 43 runs. The 2 that differ are the readable
execute's revision hashes.- A reftable source made by 2.47.1 and read under 2.43 is
unknown repository extension found: refstorage. Both versions then refuse itsource-unclonablethe same way.
- A reftable source made by 2.47.1 and read under 2.43 is
- Body numbers: every call count I re-measured matches the body's table (16/52/57/101-103/18/58/6/1/20), and the "untold" wording of rows 6 to 8 matches.
Rows (13 new)
| Run | git 2.47.1 | git 2.43.0 |
|---|---|---|
| At the head | 13 passed in 6.52s | 11 passed, 2 skipped in 2.16s (:1434, needs 2.45) |
Parent's adopt-project.py swapped in (restored, cmp OK) |
5 failed, 8 passed | 3 failed, 8 passed, 2 skipped |
On 2.47.1 against the parent, the failures are ..._backend_reads[reftable-check], [reftable-execute], and ..._is_not_walked[refs-own], [refs-fetched], [stray-origin-fetched]. This matches W1291.
The imports from test_adopt_root_symlinks are a marker, a string and a function, not fixtures, so the #1188 hazard does not apply. The gate below runs both modules in one pytest anyway.
Mutants (my own; each restored and checked with cmp, 13 rows on 2.47.1)
| Mutant | Result |
|---|---|
R1: a refs/heads that is not a directory, absent included, counts as the mark |
SURVIVED, 13 passed (see N1) |
R2: a refused stat of a mark is raised, not read as "walk" |
KILLED, 2 failed: ..._git_cannot_search_...[own], [fetched] |
R3: marks asked only after a refusal, and only where that refusal is at refs itself |
KILLED, 1 failed: ..._is_not_walked[stray-origin-fetched] |
Gates at e9798fa (one pytest at a time, -rs, clean tree before and after)
| Run | Result |
|---|---|
test_adopt_tracking_branch.py, test_adopt_github_exits.py, test_adopt_unsearchable_source.py, test_adopt_root_symlinks.py, git 2.47.1 |
367 passed in 459.21s |
| the same, git 2.43.0 | 362 passed, 5 skipped in 452.81s (tracking :1434 x2; root_symlinks :1960, :2015, :2596, all "needs git 2.45") |
| Guards (repo_hygiene, agents_md_codes, git_output_decoding, stdout_encoding, cli_reference, path_guard_hygiene, no_auto_maintenance, update_add_codes_documented), git 2.43.0 | 470 passed, 3 skipped in 94.95s |
| the same, git 2.47.1 | 470 passed, 3 skipped in 87.52s |
test_scaffold_leg_path_collisions.py, git 2.43.0 |
104 passed in 5.01s |
test_shape_doctor.py, git 2.43.0 |
446 passed, 3 skipped in 783.58s (:10516 x3, Windows only) |
- flake8: 36 findings at the parent and at the head, the same findings.
- SonarCloud: gate OK. Its 4 open issues (
adopt-project.py:2356, tracking:1165,:1184,:1227) are outside this PR's hunks. - CI:
testsis still pending on e9798fa.package,tests-git-bashand SonarCloud pass. - Does W1291's re-gate suffice? I could not check that
e9798fabdiffers frombb81493aonly by the moved import:bb81493ais not on GitHub (No commit found for SHA: bb81493a, HTTP 422). My own gates above cover the head'sadopt-project.pyin its own modules, the import chain, the guards, collisions and the doctor. The other area modules import nothing from the tracking module, so I judge the area gate sufficient. They were not re-run at this head. If lane 3 wants them, the command is below.
Merges (git merge-tree --write-tree)
- Main: clean with
2af1d664(tree1869c579aad4). Main then moved tof7f34fb0, which is adopt-project.py: the mount removes a path a case twin is at or under withgit rm -fand writes the twins the root keeps back from the index, so on a disk that ignores caseexecutekeeps a set the plan splits across repositories or drops (#1183) #1237 landing; the merge is clean there too (treeb256a6781ef9), and that change does not touch the walk or reftable (0 hits for_unlisted_ref_directory,_refuse_unlisted,_common_dir_on_diskorreftablein its diff). CI'steststests the merge with the older main, so lane 3's usual refresh applies. - Other PRs: clean with validate-family.py: a member whose git directory's
HEADthis user cannot open, under.git/modules/<path>or in a.gitdirectory, is refusedmember-unreadableby name, where it endedmember-commit-unresolvablewith a fetch (#1256) #12631962f749(17a8e7d484eb), repo_shape.py and adopt-project.py: a local source'soriginpast GitHub's limits (an owner over 39 characters, a repository over 100) names noorg/repo, by the rule_github_namereads a typed name by, soplan --org testorgis no longer told to pass--org <40 c's>,checkholds the plan alike withoriginthere or gone, and the doctor's adoption line asks for--org(#1211) #1304ec240265(1168d3ceba76) and validate-pins.py and validate-family.py: a leg's or member's git-directoryHEADthat is a FIFO, a socket or a device, or a symlink to one, is refused by name before git is asked, where a FIFO left the gate with no answer at all (#1290) #1319be62b704(c9c8cb1fb3df). validate-family.py: a member whose git directory'sHEADthis user cannot open, under.git/modules/<path>or in a.gitdirectory, is refusedmember-unreadableby name, where it endedmember-commit-unresolvablewith a fetch (#1256) #1263 and validate-pins.py and validate-family.py: a leg's or member's git-directoryHEADthat is a FIFO, a socket or a device, or a symlink to one, is refused by name before git is asked, where a FIFO left the gate with no answer at all (#1290) #1319 touch neither of this PR's files. - adopt-project.py: a source whose only remote is not named
origin, asclone.defaultRemoteNamenames it, is read from that remote, soplanreads its organisation, default branch and branches where it refusedadopt-no-org, took HEAD's branch as the default and asked--tracking-branchof the source's own branches, and one with several remotes and nooriginnames them and guesses none (#1276) #1280 and shape-doctor.py: a repository whose only remote is not namedoriginis offered the adoption lineplantakes,--project Thingwith no--org, where it was--project WorkUpstream --org <your-org>, whichplanrefusedadopt-not-the-source; thenamingrow and the Triad advisory read that remote too (#1292) #1320:adopt-project.pyconflicts in 5 hunks each. With the labels stripped they are identical, hunk for hunk, to the same merge of adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's head, so they are adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's. The PR's own lines merge outside them. - The body's list: every clean merge it names reproduces, including adopt-project.py:
checkandexecutework the follow-ups out from the plan as it stands andplanno longer stores them, so after a hand edit of an entry'sleg:neitherchecknor the split commit names aGNUmakefileor a collision the root no longer keeps, and a plan that still holds afollow_ups:list is refused by name (#1206) #1312a581a837a309and adopt-project.py and scripts/shape_materialize.py: a keptMakefile/DIRECTORY is no Makefile of the source's own, so theCONTRACTS_DIRline, the Makefile's collision line and NEXT say GNU make stops at it, in the words a keptGNUmakefile/(#1207) andmakefile/(#1312) get, and none says the shape's Makefile waits to be merged with it (#1314) #1321a8b09875a6e6. tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209 conflicts only intests/test_adopt_plan_paths_spelled.py, at adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's head too.
Body
Closes #1291is the only closing keyword, with no bot section, andclosingIssuesReferencesreads [1291].- It is ASCII except U+1F916 on the robot line.
- It covers what a person sees change, the choices, the departure, the git build and the restack plan.
Findings
MUST: none. SHOULD: none.
NIT N1 (row, optional). R1 survives because no row has a common directory with reftable and no refs/heads. On every repository git makes, R1 behaves the same (git always makes refs/heads). A fifth case, reftable without refs/heads walked as before, in test_a_common_directory_with_one_reftable_mark_is_walked_as_before would pin the docstring's "a refs/heads that is a FILE".
NIT N2 (body, Out of scope). Add after the "reftable directory is gone" bullet:
"- A reftable repository whose refs/heads file is gone: git 2.47.1 lists every ref with refs at --x, exit 0. It holds one mark, so the walk runs as before and names refs, as at #1265's head. It is a broken repository, not a mode."
NIT N3 (body). Replace "38 of 38 files identical, the stdout, stderr and git call log of each of the 19 runs (rows 9 to 15)." with:
"38 of 38 files identical: for each of the 19 runs (rows 9 to 15), one file with its exit, stdout and stderr, and one with its git call log."
NIT N4 (body). Replace "and a files clone moved by git refs migrate --ref-format=reftable," with:
"and a files clone made without reflogs and moved by git refs migrate --ref-format=reftable (git 2.47.1 refuses to migrate one with reflogs: migrating reflogs is not supported yet),"
NIT N5 (body, Gates). Replace "Gated commit: bb81493a, with a clean tree before and after." with:
"Gated commit: bb81493a, a local commit never pushed, with a clean tree before and after."
NIT N6 (body, Merges). #1237 has landed as main f7f34fb0. Replace "Clean with #1237, #1249," with "Clean with #1249,". Then add:
"- This head + main f7f34fb0 (#1237 landed): clean, tree b256a6781ef9."
Paths and what is left
- Clone:
/workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1291, detached at e9798fa, clean. Its linked worktreeRV1291-scratch/wt-parentis at 39b21c0. - Scratch:
/workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1291-scratch- git facts:
gitfacts.sh,gitfacts-247.txt,gitfacts-243.txt,gitfacts-migrate-247.txt - before/after probe:
probe.py,probe-all.sh,probe-out2/,probe-summary.txt,rt-under-243.sh - rows and mutants:
rows.sh,mutate.py,mut-*.log - gates:
gates.sh,gates.log,gate-*.log CHECKPOINT.md
- git facts:
- Not run at this head: the doctor under git 2.47.1 (it passed under 2.43.0), and the area modules outside the import chain, under either git. Commands:
cd /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1291 && /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1291-scratch/envrun-git247.sh /dev/null /usr/bin/python3 -m pytest -q -p no:cacheprovider -rs --basetemp=/tmp/claude-1000/l3bt/RV1291-doctor-247 tests/test_shape_doctor.pycd /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1291 && /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1291-scratch/envrun.sh /dev/null /usr/bin/python3 -m pytest -q -p no:cacheprovider -rs --basetemp=/tmp/claude-1000/l3bt/RV1291-area-243 tests/test_adopt_pins.py tests/test_adopt_plan_partial_clone.py tests/test_adopt_partial_clone_source.py tests/test_adopt_unenterable_source_and_locale.py tests/test_adopt_unreadable_clone_git.py tests/test_adopt_unreadable_git_parts.py tests/test_pin_source_unreadable.py tests/test_adopt_split_branch.py- For git 2.47.1, run the second command with
envrun-git247.shand basetempRV1291-area-247.
- I did not re-run W1291's own mutants M1 to M6.
Lane 3: READY stands. Lane 3 measured the one thing RV1291 could not. bb81493a, the gated commit, is in W1291's clone and differs from e9798fab only in tests/test_adopt_tracking_branch.py, by the moved import (3 insertions, 2 deletions); adopt-project.py is the same bytes. So W1291's area gate on bb81493a, under both gits, stands for this head.
- The doctor under git 2.47.1 is not run again: RV1291's doctor run under git 2.43.0 skipped no row for want of git 2.45, so no doctor row makes a reftable repository, and git 2.47.1 still makes the files backend by default.
- Taken now, in the body: N2 to N6, as RV1291 words them.
- Not taken: N1, an optional row for a common directory with
reftableand norefs/heads. git makes no such repository, and R1 differs from the head only there. It goes on the list of follow-up candidates for Brett Heap.
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 4 days and 17 hours by commenting |
Lane: openRepoShape-3 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… that conflicted The PR's own no-context lines over the squash equal its lines over #1265's head 39b21c0, and the tree is f2b5ba5, the tree of this PR's own range applied to #1265's squash. Lane: openRepoShape-3 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
(lane openRepoShape-3, 2026-11-10T23:19:52Z) Restacked after #1265 landed. The new head is
|
|



What changed
A v1.2.2 fix for #1291, which lane 3 filed on Brett Heap's word "file follow-ups 5, 10 and 15" (2026-11-09) from finding N1 of rv1265, lane 5's independent review of #1265. v1.2.2 is the patch Brett Heap opened on 2026-11-08T20:34:16Z ("yes freeze v1.2.1 and create v1.2.2"): no new command or flag, and its PRs land after the v1.2.1 tag, in the order lane 3 posts.
What a person sees change. A source git keeps on the reftable backend (git 2.45 and later), whose
.git/refsthis user can search and not list (mode--x), is read as git reads it again:checksaysplan ok, as at b7a00b3 (adopt-project.py: a source whoserefsthis user cannot list is refusedsource-unreadablenaming the directory, neversource-default-branch-not-local"(its branches: none)" (#1219) #1252 merged, before adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265). At adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's head it wasREFUSED source-unreadable: the source's `refs`, <path>: cannot be read (Permission denied), so the source's branches cannot be told.execute --local-remote-diradopts it (adoption verified), where adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's head refused it the same way.FINDING adopt-branch-existsagain, notsource-unreadable.Nothing else changes. Every files-backend source prints the same bytes and runs the same git calls, call for call (measured below).
The change.
_unlisted_ref_directory(adopt-project.py:3624), #1252's walk, returns None at once where the common git directory it is given holds both marks the reftable backend leaves (_keeps_refs_in_a_reftable,:3668): arefs/headsthat is a FILE, and areftablethat is a directory. With one mark alone, or astatrefused, it walks as before. Every caller of the walk gets the answer:source-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's_refuse_unlisted_refs_if_seen(:10907), for the split branch incheckandexecute --local-remote-dir;refsthis user cannot list is refusedsource-unreadablenaming the directory, neversource-default-branch-not-local"(its branches: none)" (#1219) #1252's_refuse_unlisted_refs(:3601), asked only where git's answer was none (the default branch,origin/HEAD, the tracking branch).The choice of test is written in
_keeps_refs_in_a_reftable's docstring, and the reach of the skip in_unlisted_ref_directory's, where the next writer reads them.The two choices, settled by measurement on git 2.47.1
git 2.47.1 built from kernel.org's tarball, its sha256 checked (see Gates). uid 1000, Python 3.12.3. Probe:
W1291-scratch/gitprobe.sh.What says "reftable": both marks, read on the common git directory the walk is given.
GIT_DEFAULT_REF_FORMAT=reftable, and a files clone made without reflogs and moved bygit refs migrate --ref-format=reftable(git 2.47.1 refuses to migrate one with reflogs:migrating reflogs is not supported yet), each had.git/refsholding onlyheads, a regular file reading "this repository uses the reftable format", beside a.git/reftabledirectory, andextensions.refstorage = reftable. git's ownreftable_be_create_on_disk(refs/reftable-backend.cin 2.47.1) writes both.refs:.git/reftabledirectory made by hand, andrefsat--x:for-each-ref refs/heads/printed nothing, exit 0, thoughmainand a split branch were there, loose. Read alone, that mark would skip the walk and lose adopt-project.py: a source whose.git/refs/headsthis user cannot read is refusedsource-default-branch-not-localwith(its branches: none), a false list, where the refusal should name the directory git could not list #1219's refusal ofrefs.refs/headsmade a file, andrefsat--x:for-each-ref refs/remotes/origin/left out the split branch kept loose there. Read alone, rv1265's mark would skip that walk too. (The tool cannot plan such a source at all:git show-ref --verify refs/heads/mainfails,git-failed.)extensions.refStoragein the repository's config, which the tool does not parse.refs/headsisstated throughrefs, so it is read whereverrefscan be searched, which is wherever git takes the directory for a repository at all:is_git_directoryasksaccess(refs, X_OK). Withrefsat 000 orr--, git saysfatal: not a git repositoryon either backend; thestatis refused, the helper says False, and the walk namesrefsas before.How much of the walk to skip: all of it, for
BRANCH_REFSandORIGIN_BRANCHES.refsat--x(and at-wx):for-each-ref refs/heads/listedrefs/heads/main, andfor-each-ref refs/remotes/origin/listedorigin/HEAD,origin/devandorigin/main, each exit 0. SoORIGIN_BRANCHESneeds the skip as much asBRANCH_REFS: at adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's head, a reftable clone whose own split branch git lists was refused at the next question, "so the branches of the source's remoteorigincannot be told" (row 6 below).refs/remotes/origindirectory made there by hand at mode 000: git listedorigin's refs from the tables all the same, exit 0, withrefsreadable and at--x. A skip ofrefsalone would still walk into that directory and refuse it, as adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's head does (row 8).refsat--x: git listed every ref. The walk is given the common git directory (_common_dir_on_disk), where both marks are.Measured, before and after
Own probe (
W1291-scratch/probe.py, built on W1257's): stubgh,--local-remote-dir, every mode put back, each source planned while readable and recorded as a cloneplanmade, and git calls counted by a logging wrapper. "Parent" is #1265's head39b21c07, "after" is this head, and b7a00b3 is #1265's base. Rows 1 to 8 are reftable sources, on git 2.47.1; rows 9 to 15 are files-backend sources, run at the parent and after on git 2.43.0 and on git 2.47.1 with the same exits, refusals and call counts on both. The b7a00b3 column is git 2.47.1's.39b21c07check/executeplan ok(57 calls) /adoption verified(101)plan ok(57) /adoption verified(103).git/refsat--xcheckplan ok, exit 0 (57)refs", exit 2 (16)plan ok, exit 0 (57): output and git calls equal b7a00b3'sexecuteadoption verified(101)refs, exit 2 (52)adoption verified, exit 0 (103)GIT_DEFAULT_REF_FORMAT=reftablefor the tool's own repositories toocheck/executeplan ok/adoption verifiedrefs/ REFUSEDrefsplan ok/adoption verified.git/refsat 000plan/checkgit-failed(not a git repository) /source-unclonable(main's.git/refsrefusal came after b7a00b3).git/refsbefore any walk, 1 git call each.git/refsatr--checksource-unclonablerefs/heads/adopt,.git/refsat--xcheckFINDING adopt-branch-exists, exit 1 (58)refs, "so the branches of the source's remoteorigincannot be told" (18)FINDING adopt-branch-exists, exit 1 (58), equal to b7a00b3'srefs/remotes/origin/adoptcheckFINDING adopt-branch-exists, exit 1 (58)refs, "so the source's branches cannot be told" (16)FINDING adopt-branch-exists, exit 1 (58), equal to b7a00b3'srefs/remotes/originmade by hand at 000checkplan ok(57)refs/remotes/origin(18)plan ok(57), equal to b7a00b3'splan/check/execute.git/refsat--xplan/check/executerefs(6 calls each)refs(6 each)refs/headsat 000checkrefs/heads(6)refs/heads/adoptat 000check/executeplan ok/ both legs pushed, thenREFUSED pushing the split branch, exit 2 (93)refs/heads/adopt(16 / 52)refs/remotes/origin/adoptat--xcheckplan okrefs/remotes/origin/adopt(18).git/reftablemade by hand (one mark),.git/refsat--xcheckrefs(6)refs(6)refs/headsmade a file (the other mark)plan, readable and at--xgit-failed,show-ref --verify refs/heads/main(6)Byte for byte, with temp-folder names normalised, parent against after:
checkandexecute) and rows 6, 7 and 8 (check).checkof rows 2, 3, 6, 7 and 8 is identical, output and git calls. Every other difference is main's own (plan18 to 20 calls,execute101 to 103) or adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's (rows 12 and 13).The issue's first row asked for
plan okat 000 too. That cannot hold: withrefsat 000 git takes the source for no repository, and the source is refused naming.git/refsbefore any walk, at the parent and after alike (rows 4 and 5).Rows
13 rows in
tests/test_adopt_tracking_branch.py, which holds #1219's and #1257's rows of this walk and the helpers they use (refs_at,refs_refused,unlisted_here,a_clone,planned_as_cloned,asked_of). The reftable mark and skip come fromtests/test_adopt_root_symlinks.py(needs_reftable,refs_on_reftable,REF_FORMAT), so these rows make and skip a reftable repository as the repository's other reftable rows do.39b21c07test_refs_git_can_search_and_not_list_are_asked_as_their_backend_readsreftablexcheck,execute: a reftable clone,.git/refsat--x. Skipped before git 2.45, as root and on Windowssource-unreadable,refs)filesxcheck,execute: control, still refused namingrefstest_a_reftable_common_directory_is_not_walkedrefsrefused toos.scandir(as at--x), forrefs/heads/andrefs/remotes/origin/, and a strayrefs/remotes/originrefused. Runs on any git, as root and on Windowstest_a_common_directory_with_one_reftable_mark_is_walked_as_beforerefs/headsa file alone, orreftablealone, x both prefixes:refsnamed withEACCEStest_a_reftable_common_directory_git_cannot_search_is_walked_as_beforerefsat 000, x both prefixes:refsnamedAgainst the parent's
adopt-project.py: 5 failed, 8 passed on git 2.47.1, and 3 failed, 8 passed, 2 skipped on git 2.43.0 (the reftable cases skip there).The files-backend refusals are held by existing rows, unchanged and passing:
test_a_clone_whose_refs_git_can_search_and_not_list_is_named(refsat--x,plan),test_a_clone_whose_branches_git_cannot_list_is_refused_by_name(refs/headsat 000,--xandr--),test_a_remote_whose_branches_git_cannot_list_is_named(refs/remotes/origin), andtest_a_split_branch_git_cannot_list_is_refused_by_check(#1257's).Mutants
Own script (
W1291-scratch/mut.py): each mutant written intoadopt-project.py, the 13 rows run on git 2.47.1, the file restored and checked withcmpagainst the fixed copy (cmp OKafter each).adopt-project.pyreftableCLI rows, the 3 hand-made reftable rows (on git 2.43.0: the 3 hand-made rows)refs/headsa file alone says reftable..._one_reftable_mark_...[heads-file-alone-own],[heads-file-alone-fetched]reftabledirectory alone says reftable..._one_reftable_mark_...[reftable-alone-*],..._git_cannot_search_...[own],[fetched]refs/heads/only..._backend_reads[reftable-check],..._is_not_walked[refs-fetched],[stray-origin-fetched]refsonly, the walk going on fromrefs/headsorrefs/remotes..._is_not_walked[stray-origin-fetched]statread as reftable..._git_cannot_search_...[own],[fetched]The mutants ran before a reflow of one docstring; the code is the same, by
astwith docstrings taken out.Gates
Gated commit:
bb81493a, a local commit never pushed, with a clean tree before and after. This head,e9798fab, differs from it only intests/test_adopt_tracking_branch.py, where one import moved below the next, under a comment, so that #1312 and #1321 merge clean (see Merges).adopt-project.pyis the same bytes. The tracking module andtest_adopt_github_exits.py, which imports from it, ran again on this head: 114 passed in 124.79s on git 2.47.1, and 112 passed, 2 skipped in 131.55s on git 2.43.0 (the 2 reftable cases). Each run is/usr/bin/python3 -m pytest -q -p no:cacheprovider -rs, one pytest at a time, uid 1000, Python 3.12.3. Each runs with a stubgh(exit 97) first on PATH, then git-filter-repo 2.47.0 (CI's pin);GH_TOKEN=bogus, an emptyGH_CONFIG_DIR,GIT_SSH_COMMAND=false,GIT_CONFIG_GLOBAL=/dev/null, andLANES_LANEunset. Each group ran twice: on the bench's git 2.43.0, and with git 2.47.1 first on PATH after the stub and filter-repo.git 2.47.1 was built for this:
https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.47.1.tar.xz.f3d8f9bb23ae392374e91cd9d395970dabc5b9c5ee72f39884613cd84a6ed310, was checked against kernel.org'ssha256sums.asc:git-2.47.1.tar.xz: OK. That file's signature could not be checked here, as the bench has no key for it.make -j16 prefix=<lane 3's tools folder> NO_CURL=1 NO_OPENSSL=1 NO_GETTEXT=1 NO_TCLTK=1 NO_PYTHON=1 NO_PERL=1 install.git --version:git version 2.47.1.test_adopt_tracking_branch.py, withtest_adopt_github_exits.py(which imports from it),test_adopt_root_symlinks.pyandtest_adopt_unsearchable_source.py(which it imports from). Thesource-unreadablemodules that runadopt-project.py:test_adopt_pins.py,test_adopt_plan_partial_clone.py(withtest_adopt_partial_clone_source.py, its fixtures),test_adopt_unenterable_source_and_locale.py,test_adopt_unreadable_clone_git.py,test_adopt_unreadable_git_parts.pyandtest_pin_source_unreadable.py. Thentest_adopt_split_branch.pyandtest_scaffold_leg_path_collisions.pytest_repo_hygiene.py,test_cli_reference.py,test_agents_md_codes.py,test_git_output_decoding.py,test_stdout_encoding.py,test_path_guard_hygiene.py,test_no_auto_maintenance.py,test_update_add_codes_documented.pytests/test_shape_doctor.py(in the background, with a log)Skips:
test_adopt_tracking_branch.py:1434at this head); three are adopt-project.pycheck: a root-kept symlink into the clone's.git, or through a kept link to a declared pin's file, passes, or is refused for a reason that is not true #904's (test_adopt_root_symlinks.py:1960,:2015,:2596). All 5 ran and passed on git 2.47.1, where the area run has no skip.test_stdout_encoding.py:292(Windows only) andtest_no_auto_maintenance.py:222twice (the session began withGIT_CONFIG_GLOBALset).test_shape_doctor.py:10516three times (Windows only).Also checked:
Not run:
source-unreadable. They test other tools' code of that name (pins,scaffold,setup-project.py) and never runadopt-project.py.needs_a_mode; the hand-made rows run as root.Merges
git merge-tree --write-treeof this head with main, and with each open PR that touchesadopt-project.pyortests/test_adopt_tracking_branch.py, and the same of #1265's head alone. The heads were fetched by URL and checked againstgh pr list, read before the gates and again after them, at 19:44Z (#1171 had landed by then; #1209, #1321 and #1322 were new).2af1d664: clean, tree1869c579aad4. Main moved during the gates by two landings:838358bf(inadopt-project.py, the spelling of default-ignorable characters) and2af1d664(tests only). Neither touches the walk. Againstf39c6707, where the measurements and gates started, it was clean too.f7f34fb0(adopt-project.py: the mount removes a path a case twin is at or under withgit rm -fand writes the twins the root keeps back from the index, so on a disk that ignores caseexecutekeeps a set the plan splits across repositories or drops (#1183) #1237 landed): clean, treeb256a6781ef9.yaml-unparsableby its line, where it was aValueErrortraceback or "the number inf", and_read_assays a float in digits with no exponent, where it said "the number 1e+300" (#1212) #1249, adopt-project.py and update-shape.py: a revision git is asked about ends its argv in--, so a root file namedHEADno longer stopsexecutewith exit 128 before that leg is pushed, nor blanks whatapply --branchsays it committed (#1215) #1294, adopt-project.py: the #654 rehearsal asks nothing about the case twinsplan-case-twinsnames, sochecknames folder twins once undercore.ignorecase=true, never again asplan-file-reencodedover git'swill not add file alias, and names the files beside them as it does without that setting (#1184) #1297, repo_shape.py and adopt-project.py: a local source'soriginpast GitHub's limits (an owner over 39 characters, a repository over 100) names noorg/repo, by the rule_github_namereads a typed name by, soplan --org testorgis no longer told to pass--org <40 c's>,checkholds the plan alike withoriginthere or gone, and the doctor's adoption line asks for--org(#1211) #1304, adopt-project.py:checklists an unanswered entry with the plan's problems against its source, before the split branch and the entries, so beside an uncovered path, an unsafe path, a bad leg path, the split branch taken or another entry finding its first finding isexecute's refusal,plan-unresolved(#1197) #1305, adopt-project.py: a refused command's--- output ---block spells each argument and directory that holds a line feed where git names it,adopt-mount-unaddablespells git's output, and rows pin mutants R1, R3 and R10 (#1233) #1311, adopt-project.py:checkandexecutework the follow-ups out from the plan as it stands andplanno longer stores them, so after a hand edit of an entry'sleg:neitherchecknor the split commit names aGNUmakefileor a collision the root no longer keeps, and a plan that still holds afollow_ups:list is refused by name (#1206) #1312, adopt-project.py:check, given no--local-remote-dir, asks GitHub nothing about the two legs of a plan for another repository and prints no NOTE thatexecuteasks again, asexecuterefusesplan-not-the-sourcefirst and asks nothing; under--local-remote-dirit still asks the disk (#1232) #1313, adopt-project.py and scripts/shape_materialize.py: a keptMakefile/DIRECTORY is no Makefile of the source's own, so theCONTRACTS_DIRline, the Makefile's collision line and NEXT say GNU make stops at it, in the words a keptGNUmakefile/(#1207) andmakefile/(#1312) get, and none says the shape's Makefile waits to be merged with it (#1314) #1321 and scripts/shape_materialize.py and adopt-project.py:CommandFailed.loudlyspells the step, the command, the directory and the output of the REFUSED block, so the four tools that print it no longer put a bidirectional control or an ESC there raw, and_init_refused,source-unclonableand bothadopt-remote-unreadableroutes spell the argument list and git's or gh's words as_unacteddoes (#1213) #1322.origin, asclone.defaultRemoteNamenames it, is read from that remote, soplanreads its organisation, default branch and branches where it refusedadopt-no-org, took HEAD's branch as the default and asked--tracking-branchof the source's own branches, and one with several remotes and nooriginnames them and guesses none (#1276) #1280 (5cb1abdb) and shape-doctor.py: a repository whose only remote is not namedoriginis offered the adoption lineplantakes,--project Thingwith no--org, where it was--project WorkUpstream --org <your-org>, whichplanrefusedadopt-not-the-source; thenamingrow and the Triad advisory read that remote too (#1292) #1320 (9d71536d):adopt-project.pyconflicts in 5 hunks each. They are the same 5 hunks, byte for byte, as with adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's head alone, in_default_branch,_from_the_remote,_tracking_branch_problem,_places_check_asksand_check_split_branch. They are adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's, not this PR's.--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209 (13a2c58c):tests/test_adopt_plan_paths_spelled.pyconflicts, and conflicts the same way with adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's head alone. This PR does not touch that file.checkandexecutework the follow-ups out from the plan as it stands andplanno longer stores them, so after a hand edit of an entry'sleg:neitherchecknor the split commit names aGNUmakefileor a collision the root no longer keeps, and a plan that still holds afollow_ups:list is refused by name (#1206) #1312 and adopt-project.py and scripts/shape_materialize.py: a keptMakefile/DIRECTORY is no Makefile of the source's own, so theCONTRACTS_DIRline, the Makefile's collision line and NEXT say GNU make stops at it, in the words a keptGNUmakefile/(#1207) andmakefile/(#1312) get, and none says the shape's Makefile waits to be merged with it (#1314) #1321 conflicted withbb81493ain one hunk at the tracking module's imports, and with adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's head alone they merge clean. Both addprinted_follow_upsto theconftestimport, andbb81493aadded itstest_adopt_root_symlinksimport on the next line. This head moves that import below thetest_adopt_unsearchable_sourceone, and both merge clean (treesa581a837a309anda8b09875a6e6).Stacked, then restacked
Stacked on #1265 (head
39b21c07ea3e6a4a1608299df201786cc5431e22); this PR's own change is39b21c07..e9798fab. Review that range.#1265 landed at 22:10Z on 2026-11-10 as
dcf63b8b. Lane 3 then restacked this PR onto its squash with two merges (restack-1324.sh): #1265's final head9eecc2da, then the squashdcf63b8b, taking ours for this PR's own file that conflicted (tests/test_adopt_tracking_branch.py). Main was the squash, so no third merge was needed.93424b9chas treef2b5ba54e: the tree of this PR's own range applied to the squash (git merge-tree --write-tree --merge-base 39b21c07 dcf63b8b e9798fab).e9798fabover39b21c07(cmp), so the restack changed none of the reviewed lines.Out of scope (seen, not changed)
refs/heads/.hidden, which git's loose-ref listing skips, reaches the same wider walk (rv1265 N1, naming RV1252's N2). It is a files-backend question, and adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's body says so.source-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's.execute --local-remote-dirwithrefs/remotes/origin/adoptatr--(rv1265's out of scope) is its own. Whether the walk runs in everycheckis adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's decision.refsat 000 orr--is refused naming.git/refsbefore any walk (adopt-project.py:2344,CLONE_WHOLE_UNTOLD; rows 4 and 5): git takes it for no repository, so no answer of the walk could be read there.reftabledirectory is gone: git 2.47.1 lists no ref and exits 0. It holds one mark, so the walk runs as before, and withrefsat--xnamesrefs. It is a broken repository, not a mode.refs/headsfile is gone: git 2.47.1 lists every ref withrefsat--x, exit 0. It holds one mark, so the walk runs as before and namesrefs, as at adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #1265's head. It is a broken repository, not a mode._clone_ref_store(adopt-project.py:12415) asks the tool's own throwaway repository forreftablealone. That is a repository git has just made, where both marks are git's, so it is not changed.Independent review
RV1291, lane 3's independent opus review (issuecomment-6778652036), reads READY at
e9798fab, with no MUST and no SHOULD. It judged all three choices right:refs;.git/refsat 000 orr--is no repository to git (fatal: not a git repository), and the tool refuses it naming.git/refsbefore any walk, the same bytes before and after.Its own probe, 74 runs on git 2.47.1 and 43 on git 2.43.0, found every changed output to be what #1291 asks, and every other output the same but for temporary names and the hashes of the tool's own revision. The 13 rows: 13 passed on git 2.47.1, and 11 passed with 2 skipped on git 2.43.0. With the parent's
adopt-project.py, 5 failed on git 2.47.1 and 3 on git 2.43.0. Its mutants R2 and R3 were killed. Its gates ate9798fab:tests/test_adopt_tracking_branch.py,tests/test_adopt_github_exits.py,tests/test_adopt_unsearchable_source.pyandtests/test_adopt_root_symlinks.pyin one run: 367 passed on git 2.47.1; 362 passed, 5 skipped on git 2.43.0;tests/test_scaffold_leg_path_collisions.py: 104 passed, andtests/test_shape_doctor.py: 446 passed, 3 skipped, on git 2.43.0.Lane 3 checked the one thing RV1291 could not:
bb81493adiffers frome9798fabonly intests/test_adopt_tracking_branch.py, by the moved import (3 insertions, 2 deletions), so the area gate onbb81493astands for this head.Taken here: N2 to N6, all in this body.
Not taken: N1, an optional row for a common directory with
reftableand norefs/heads. git makes no such repository, and RV1291's mutant R1 differs from the head only there. It is a follow-up candidate for Brett Heap.Closes #1291
Lane: openreposhape-3 (openRepoShape-3)
🤖 Generated with Claude Code
Summary by Sourcery
Read reftable-backed sources according to Git's ref storage behavior so searchable but unlistable
.git/refsdirectories no longer cause false adoption refusals.Bug Fixes:
.git/refsdirectory is searchable but not listable without incorrectly reportingsource-unreadable.checkto produce a valid plan andexecute --local-remote-dirto adopt reftable sources while preserving existing files-backend behavior.Enhancements:
Tests: