Skip to content

bump-leg.py: the leg's fetch carries every refspec of the leg's own that can bring a tag under origin/ (tags onto the branches' names or in a folder, a mirror into origin/ or in a folder, a short name), so a branch and a tag of one name fail it and a tag answers for a branch, as family.py bump's did before #946 and #1027 #1037

Closed

Description

@brettheap

Goal: bump-leg.py's fetch of a leg leaves out every refspec of the leg's own that can bring a tag under refs/remotes/origin/, and one that gives another namespace the branches' names. A tag then never answers for a branch in on_a_remote_branch, and the fetch never fails where the leg's own git fetch origin works. This is what #946 (#905) and #1027 (#1009) did for family.py bump's member fetch.

Lane openRepoShape-4's RV1027 asked for this issue in its review of #1027 (issuecomment-6280876954). Lane 4's W1009 measured the states below.

State on main e2f9fc424 (scripts/bump-leg.py):

Measured in process on git 2.43. Each refspec was the only remote.origin.fetch of a scratch repository, asked of bump-leg.py's _leg_fetch_refspecs and of family.py's _origin_fetch_refspecs at #1027's head:

refspec bump-leg.py family.py (#1027)
+refs/tags/*:refs/remotes/origin/* CARRIED left out
+refs/tags/*:refs/remotes/origin/tags/* CARRIED left out
+refs/*:refs/remotes/origin/* CARRIED left out
+refs/*:refs/remotes/origin/all/* CARRIED left out
+x:refs/remotes/origin/x CARRIED left out
+refs/pull/*/head:refs/remotes/origin/pr/* CARRIED CARRIED

What follows, by the mechanism #946 measured for members. This has NOT yet been measured end to end on a leg.

  • Where a branch and a tag of the remote share the name such a refspec writes, the leg's fetch exits 128 with "Cannot fetch both". bump-leg.py then gives its failed-fetch note, though the leg's own git fetch origin exits 0.
  • Where no name is shared, the tag under origin/ answers for a branch, so bump-leg.py would pin a commit only a tag reaches. That is against family.py bump --to: pins a commit only the member's mount holds, which bump-leg.py refuses as local-only #613's rule that a tag is not a branch, which its own bump-leg-commit-local-only refusal states (:1216).

Direction:

  • Give _leg_fetch_refspecs the clauses family.py's _origin_fetch_refspecs has:
    • a destination outside refs/remotes/origin/ (it has this one already);
    • a source that can name a tag: under refs/tags/, a pattern whose part before the * is a start of refs/tags/, or no pattern and not under refs/;
    • the branches' glob refs/remotes/origin/* from a source not under refs/heads/.
  • Write them in bump-leg.py, as on_a_remote_branch is written twice. Or move both tools' copies into a module they both import. The docstring at :1039 says why none holds it today.
  • Keep the pull-request refspec and the refs/review/ kind carried, so the prune still keeps their refs.
  • Fix the docstring at :1064-1072.
  • Add rows for legs like tests/test_family_bump_fetch_refspecs.py's TAGS_UNDER_ORIGIN (end to end, both runs) and WHICH_CLAUSE (in process).

Related, not in scope here: _leg_fetch_refspecs still reads git config --list a line at a time (:1080), which is #946's U184 for legs (RV946's N7 on #946).

Verify:

  • On a leg whose only refspec is each of the five tag-capable refspecs above:
    • bump-leg.py --dry-run and the real run fetch with no note where the remote has a branch and a tag of one name;
    • both refuse, in bump-leg-commit-local-only's tag words, a commit only a tag of the remote reaches;
    • no ref of the leg moves.
  • _leg_fetch_refspecs leaves out each of the five and carries the pull-request refspec.
  • grep -n "shares both" scripts/bump-leg.py finds nothing.

Filed by lane openRepoShape-4, as a follow-up of #1009 and #1027.

Lane: openreposhape-4 (openRepoShape-4)

Activity

  1. brettheap commented on Oct 20, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-4, session 11c6c0ef-495a-4a05-94cf-811b7b0a1012@Eagle, 2026-10-20T10:36:26Z, for #1037

    Logged in lanes/log/openRepoShape-4.md at f122e1b2f5d3c03d5c2df645f71f064024162bb8.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#1037:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#1037"`, kept where the row or its body names `#1037`:
    1027	family.py: `bump`'s fetch leaves out every refspec of the mount's whose 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)	fix/1009-mirror-in-a-folder	MERGED
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `1037` as a whole token:
       none
    
  2. added this to the v1.2.0 milestone on Oct 20, 2026
  3. added a commit that references this issue on Oct 20, 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