Repository navigation
Description
(lane openRepoShape-5, 2026-10-23)
Goal: the two passages of tests/test_family_bump_fetch_refspecs.py that say what the carried refspec +refs/h:refs/remotes/origin/hy takes say what git does with it, so a reader of the carried rule is not told that the source refs/h is never a branch.
Problem
#1157 (#1100) landed as 0d76e4c59. Its re-check found that the wording the last round added is not quite true (lane 5's re-check, rc1157b, NIT 1; #1157 issuecomment-6371455922, at the PR's head 368b87e9b). It is a wording NIT: the row and the code are right. Two passages say that a source refs/h, a start of refs/heads/ with no *, takes a ref "that is no branch". On main 50ce8ab15 the file's blob (6e752bbca9c9) is the PR head's, so the lines are the same:
580: #: `carried` where none does (`carried-refs-h-not-a-pattern`, a start of
581: #: `refs/heads/` with no `*`, is no pattern: it takes the one ref of that
582: #: name, which is no branch), and `skipped` for a negative refspec, which
and, in the docstring of test_which_clause_leaves_each_refspec_out (the claim is on :690-691):
689: `refs/headsx/`, which no branch is under, `refs/h` with no `*`, a start
690: of `refs/heads/` that is no pattern and takes only the ref of that name,
691: which is no branch and may stand beside the branches (the re-check of
692: #1157, NIT 1), and a branch, a folder of them or a pattern of them,
693: each under the name `BRANCHES` gives it."""
The claim is true of an exact refs/h, which is no branch. It leaves out that git also completes a source: refs/h names a branch called refs/h (refs/heads/refs/h) and a tag called refs/h (refs/tags/refs/h) as well. With a branch literally named refs/h beside hy, the tools' fetch line exits 128 with Cannot fetch both refs/heads/hy and refs/heads/refs/h to refs/remotes/origin/hy: the source is a branch there, so "no branch" is not true of it. The clash is the one the code's own docstrings list as WHAT CAN STILL CLASH (scripts/shape_materialize.py:1874-1885 at main) and as the second way a carried refspec fails (scripts/bump-leg.py:1161-1175): a carried refspec onto a name that is a branch's. Main carries the refspec the same way, so nothing is new in #1157. What the two passages get wrong is only the words "no branch".
It does not change the row. carried is still the rule for +refs/h:refs/remotes/origin/hy, and the row carried-refs-h-not-a-pattern (line 649, in WHICH_CLAUSE) still kills mutant F2, which drops the bool(star) and from the clause's return (return bool(star) and HEADS_PREFIX.startswith(fixed), scripts/shape_materialize.py:1727 at main). The commit message of 0d76e4c59 and #1157's body carry the same sentence and cannot be changed, so these two passages are the only place to correct it.
Measured
-
The re-check, rc1157b, at
368b87e9b, git 2.43.0 and 2.47.1. The remote had branchesmain,hyandrefs/h, so the refrefs/heads/refs/hand no refrefs/h. The tools' fetch line was the branches' glob plus+refs/h:refs/remotes/origin/hy. The result wasfatal: Cannot fetch both refs/heads/hy and refs/heads/refs/h to refs/remotes/origin/hy, exit 128. The row's own answer is unchanged: the review ran-k carried-refs-h-not-a-patternover both files on the head (2 passed, 123 deselected) and with F2 applied (2 failed). -
Re-run by the drafter at main
50ce8ab15, git 2.43.0 only, withGIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1and a bare remote on disk, no network. One remote per row, each givenmainandhyfrom one empty commit, then the row's ref, then, in a fresh mount with that remote asorigin:git -C mount fetch origin '+refs/heads/*:refs/remotes/origin/*' '+refs/h:refs/remotes/origin/hy'The remote also has Result of the fetch the branch refs/h(refs/heads/refs/h, by push)fatal: Cannot fetch both refs/heads/hy and refs/heads/refs/h to refs/remotes/origin/hy, exit 128 (the review's message)the tag refs/h(refs/tags/refs/h, by push)fatal: Cannot fetch both refs/heads/hy and refs/tags/refs/h to refs/remotes/origin/hy, exit 128the exact ref refs/h, made byupdate-refon the remote's diskfatal: Cannot fetch both refs/heads/hy and refs/h to refs/remotes/origin/hy, exit 128none of these fatal: couldn't find remote ref refs/h, exit 128 (the other documented way a carried refspec fails,bump-leg.py:1161-1164; not this clash)In the first three rows the clash is with the branch
hy, becauseorigin/hyis the destination, so what differs is what the message calls the source. The tag row and the exact-ref row are the drafter's, not the review's, and they show that the review's suggested wording, "or the branch git completes that name to", is narrower than git is: a tag is completed too. -
A push of the exact ref is refused. The same bare remote refused
git push ../remote.git main:refs/hwithremote: error: refusing to update funny ref 'refs/h' remotelyand[remote rejected] main -> refs/h (funny refname). So on a remote that pushes made, the "one ref of that name" the passages picture cannot exist; what such a remote can hold under that name is a branch or a tag.
Suggested fix
Wording only, in the two passages; no row and no script. The review's own words are "say 'takes the ref of that name, or the branch git completes that name to', or leave it". With the tag row the second half can say "the branch or tag", for example:
- Lines 580-582: "...is no pattern: it takes the one ref git completes that name to (
refs/hitself, or the branch or tag of that name), not the branches as a set), andskippedfor a negative refspec..." - Lines 689-693: "...
refs/hwith no*, a start ofrefs/heads/that is no pattern and takes only the one ref git completes that name to, which may be a branch or a tag namedrefs/hand, like any carried source, clashes where its destination is a branch's name (the re-check of shape_materialize.py and bump-leg.py: the fetch for a branch's answer leaves out a pattern likerefs/heads*that puts a branch under another name, its clauses move into_left_out, and the docstrings name the clashes left and the way back (#1100) #1157, NIT 1), ..."
The wording is the owner's. The file wraps at 79 columns (its longest line is 79) and holds no non-ASCII line; the re-flowed lines must too. Whether the docstrings of scripts/shape_materialize.py (:1874, "a refspec carried whose source names no branch") and bump-leg.py (:1165) want the same word is the owner's call: they describe the shape by its examples (pull requests in a folder, a single name) and make no claim about refs/h; I did not find a false sentence in them.
Verify
- The diff touches only comment lines and that one docstring of
tests/test_family_bump_fetch_refspecs.py: the file's syntax tree, with the docstring oftest_which_clause_leaves_each_refspec_outremoved from both sides, equals main's (python3 -I,ast.dump; comments are not in the tree). -k carried-refs-h-not-a-patternovertests/test_family_bump_fetch_refspecs.pyandtests/test_bump_leg_fetch_refspecs.pygives2 passed, as at368b87e9b(2 passed, 123 deselected); the two files' other ids are as before.tests/test_repo_hygiene.pyandtests/test_path_guard_hygiene.pypass; no added line is over 79 columns or holds a non-ASCII character.git grep -n 'which is no branch' -- tests/test_family_bump_fetch_refspecs.pyfinds no sentence that says the sourcerefs/htakes no branch.
Found by lane 5's re-check of #1157 (#1100), rc1157b, NIT 1 (#1157 issuecomment-6371455922), at 368b87e9b; re-read on main 50ce8ab15, where the quoted lines and their numbers are the file's, and re-run by the drafter (git 2.43.0) for the branch, tag, exact-ref and funny-ref rows.
Lane: openreposhape-5 (openRepoShape-5)
Activity
brettheap commentedon Oct 23, 2026
CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-10-23T21:21:52Z, for #1230
Logged in
lanes/log/openRepoShape-5.mdate1aed0fd77e29c994411d5f059595e824aa856e0.The three reads (lane-collision-protocol Rule 1):
shape_materialize.py: the docstring of `gives_a_branch_another_name` …