Repository navigation
tests/test_family_bump_fetch_refspecs.py: the two docstrings say #946's first head left out a tag or mirror refspec only where it wrote the branches' own names, so a tag refspec in a folder (S1) is left out only now and the mirror (S2) already was and had no test (#997) - #1007
Conversation
…s first head left out a tag or mirror refspec only where it wrote the branches' own names, so a tag refspec in a folder (S1) is left out only now and the mirror (S2) already was and had no test (#997) Text only, in two docstrings; no code and no assertion changes. The module docstring said a tag refspec and a mirror into `origin/` were "now left out (RV946's S1 and S2)", and the reachability row's docstring said both pinned the commit "in a folder or a mirror" on #946's first head, `4e1aa24a`. Only the tag refspec in a folder (`+refs/tags/*:refs/remotes/origin/tags/*`) was carried there: its destination is not the branches' own, so `_origin_fetch_refspecs`'s destination clause did not skip it. The mirror (`+refs/*:refs/remotes/origin/*`) was already skipped by that clause, and RV946's S2 asked only for a test of it. Measured against `4e1aa24a`, the file fails only the two `[tags-in-a-folder]` rows and both `[mirror-into-origin]` rows pass (RV946's round 2, NIT N6). Closes #997 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis text-only change fixes two docstrings so they accurately describe which refspec cases were already excluded, which tag-in-folder behavior is covered, and that mirror behavior now has explicit test rows; no code or assertions change. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
(lane openRepoShape-4, 2026-10-19T21:35:06Z) RV1007's review of #1007 at RV1007 is lane 4's independent reviewer for #1007 (closes #997). W997 wrote the change; I did not. No MUST, no SHOULD, one NIT. Each claim of both new docstrings is true of the code for the refspecs it names; the NIT is wording at the edges of two phrases. Findings
Observation outside the diff (not a finding against #1007). On the landed function ( What I checked and ran
No commit, push or review state was made on the PR; my scratch worktrees are under Lane: openreposhape-4 (openRepoShape-4) |
|
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 1 hour and 17 minutes by commenting |
|
…se source can name a tag, a pattern such as `refs/*` and a short name too, so a mirror in a folder, `+refs/*:refs/remotes/origin/all/*`, no longer fails the fetch on a branch and a tag of one name or pins a commit only a tag reaches (#1009) (#1027) `family.py bump` fetches the member's `origin` with `+refs/heads/*:refs/remotes/origin/*` and the mount's own refspecs that write under `refs/remotes/origin/` (#686), so that `--prune` keeps what they write. #946 (#905) left out a refspec whose source is under `refs/tags/`, and a non-branch source onto the branches' glob `refs/remotes/origin/*`. A mirror in a folder, `+refs/*:refs/remotes/origin/all/*`, met neither, so it was carried. Its `refs/*` takes every tag and writes it under `origin/all/tags/`, where `bump` reads branches. Where a branch and a tag share a name, the fetch failed ("could not fetch members/IRRS from its origin"). Where none did, a commit only a tag reaches was pinned. Lane 4's RV1007 found it while reviewing #1007. `_origin_fetch_refspecs` now asks three clauses of each positive refspec of the mount's own. Negative ones are skipped, as before. The first clause that matches leaves the refspec out: 1. A destination outside `refs/remotes/origin/`. Unchanged. 2. A source that `_can_name_a_tag`, wherever under `origin/` it writes. This is a new helper, with `_TAGS_PREFIX = "refs/tags/"`. A source can name a tag three ways: a. It is under `refs/tags/` (#946's clause). b. It is a pattern whose part before the `*` is a start of `refs/tags/`: `refs/*`, `refs/t*` or `*`. Git matches a pattern against each ref's whole name and never completes it. c. It is no pattern and not under `refs/`. That is either a short name or an exact object id. Git completes a short name, trying the name, then `refs/<name>`, then `refs/tags/<name>` before `refs/heads/<name>`: `+x:` took the tag `x` over the branch `x`, and `+heads/main:` took the branch `main`. An exact object id (`+<40 hex>:refs/remotes/origin/pinned`) names no branch. 3. The branches' glob, `refs/remotes/origin/*`, written from a source not under `refs/heads/`. Unchanged. It is now the only clause that leaves out a source that can name no tag, such as `+refs/pull/*/head:refs/remotes/origin/*`. Everything else is carried, forced, after the branches' refspec and without duplicates. That includes the pull requests (`+refs/pull/*/head:refs/remotes/origin/pr/*`), a `refs/review/` refspec whose name is not UTF-8, one branch, and branches in a folder. These were measured on git 2.43. The issue's own wording, every source that can match a ref outside `refs/heads/`, would also leave out the pull-request and review refspecs that #946 carries on purpose: its two U184 rows fail on that mutant. Keyed on tags, the rule leaves out neither. tests/test_family_bump_fetch_refspecs.py now has 33 rows; it had 13 on main. - `mirror-in-a-folder` is added to `TAGS_UNDER_ORIGIN`, so both U183 tests run it end to end: the clash row and the reachability row. - `WHICH_CLAUSE` adds 18 rows, run in process. Each says which clause leaves a refspec out, or that it is carried. They include `tag-short-name-heads-main` and `tag-object-id`. - The docstrings name the clause for each refspec, with #1007's NIT N1 wording. On main `5b41d44fc`'s `family.py`, the new file gives 9 failed and 24 passed: the two end-to-end rows and 7 table rows for 2(b) and 2(c). Here, all 33 pass. The targeted runs at `a79c957b0` all passed: - `-k bump` over every `tests/test_family*.py`: 277; - `test_repo_hygiene.py`: 100; - `test_cli_reference.py`: 23; - `test_agents_md_codes.py`: 47; - `test_no_auto_maintenance.py`: 60; - `test_family_dry_run.py`: 61. Ten mutants of the rule are killed, RV1027's RM1 and RM2 among them. Two that drop a guard survive. They change only a pattern outside `refs/` that takes no tag (`heads/*`), or a source that is no ref name (`refs/t`). Limits: - `bump-leg.py`'s `_leg_fetch_refspecs` has no tag clause, so a leg's fetch still carries every tag-capable refspec (#1037). - A full name that is no pattern can still bring a tag. Where the remote had no branch `zz`, `+refs/heads/zz:refs/remotes/origin/zz` took the tag `refs/tags/refs/heads/zz`. Leaving out every full name would drop the pull-request and review refspecs. - 2(c) leaves out every short name, `heads/main` and `HEAD` included. Where the branches' refspec writes the same name, nothing is lost. Elsewhere, the prune drops the copy until the mount's next `git fetch origin`. - A non-tag refspec in a folder can still clash with a branch. The pull requests onto `origin/pr/*` clash with a branch `pr/7` where the mount keeps no branch refspec of its own. They are carried so that their refs survive the prune. Lane 4's RV1027 found it READY at `669d611e`, with no MUST and no SHOULD. Its four NITs are taken in `a79c957b0`. Closes #1009 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>



Closes #997.
Text only: two docstrings in
tests/test_family_bump_fetch_refspecs.py(the module docstring and the reachability row's). No code, no assertion and no other file changes.Why. Both said #946's first head,
4e1aa24a, carried or pinned a tag refspec and a mirror intoorigin/("RV946's S1 and S2"). Only the tag refspec in a folder (+refs/tags/*:refs/remotes/origin/tags/*) was carried there (S1): its destination is not the branches' own, so_origin_fetch_refspecs's destination clause did not skip it. The mirror (+refs/*:refs/remotes/origin/*) was already skipped by that clause, and S2 asked only for a test of it. From RV946's round 2, NIT N6 (issuecomment-6266641009).Now.
bump's fetch no longer moves the mount's own branches, works where the mount maps tags intoorigin/instead of telling the person to fix the network, reads its refspecs withgit config --list -z, and asksgit remote get-url originfirst, so a mount with nooriginis not fetched from a path of that name (#905) #946's first head left out a tag or mirror refspec only where it wrote the branches' own names, so a tag refspec in a folder is left out now (S1), and the mirror already was and now has rows (S2).origin/tags/v-release) on family.py:bump's fetch no longer moves the mount's own branches, works where the mount maps tags intoorigin/instead of telling the person to fix the network, reads its refspecs withgit config --list -z, and asksgit remote get-url originfirst, so a mount with nooriginis not fetched from a path of that name (#905) #946's first head too (RV946's S1); the mirror (S2) had no test."Runs (stub
gh, one run at a time,-p no:cacheprovider):tests/test_family_bump_fetch_refspecs.pyalone: 13 passed.tests/test_repo_hygiene.py,tests/test_agents_md_codes.pyandtests/test_cli_reference.py: 183 passed.5d5d06bbagainst4e1aa24a's tree fail only the two[tags-in-a-folder]rows (2 failed, 11 passed); both[mirror-into-origin]rows pass.Lane: openreposhape-4 (openRepoShape-4)
🤖 Generated with Claude Code
Summary by Sourcery
Correct the fetch-refspec test documentation to reflect the tested behavior of tag and mirror refspecs.
Enhancements:
Documentation: