Skip to content

update-shape.py, family.py and bump-leg.py: the branch HEAD is on is read with .strip(), so a branch ending in U+00A0, U+2028 or U+0085 is read as its neighbour, and bump-leg.py (and update-shape.py) decode it with errors="replace", so the push line names a branch that is not there #765

Closed

Description

@brettheap

Goal: each tool that reads the branch HEAD is on reads the branch's own name, byte for byte, and one it cannot spell is refused by name before it commits, so no push line names another branch.

Filed by lane openRepoShape-5, from rv672's review of #672's PR (#746, head a5d473ee; its checklist candidates 1 and 2). Candidate 3 of that review, {root} printed raw, is in the sibling issue for raw spellings.

Lands after: lane 5's #672 (PR #746, fix/672-bump-leg-branch-and-push-line), which gives bump-leg.py the full ref and rstrip("\n") (S2 of its fix round) and the push line refs/heads/<b>:refs/heads/<b>; lane 4's #674 (fix/674-update-shape-apply, head d0699029), which gives update-shape.py's current_branch the full ref and the same push line; and lane 4's #689 (fix/689-next-push-refspec, head fa513848), which gives family.py the same. Line numbers are at main 66b230ed; where a PR head holds the line, its sha is given.

Lines

Verify: tests/test_bump_leg_branch_and_push_line.py (new in #746), tests/test_non_utf8_git_reads.py, tests/test_update_shape_landing.py and tests/test_update_shape_paste_lines.py and the family files that print a NEXT line (tests/test_family_add_refusals.py and the tests/test_family*.py files #689 edits) pass on Linux. One new case per tool with a branch ending in U+00A0 beside the same name without it: the tool reads each as itself, and its refusal or push line names the branch it is on; and one per tool with a branch named with byte 0xE9 (POSIX only, skipped where the filesystem refuses the name, as skip_where_a_name_cannot_be_not_utf_8 does after #723), asserting the refusal or the spelled line. Mutate rstrip("\n") back to strip() and see the case fail, as #746's R-mutants did for bump-leg.py.

Overlaps. fix/672-bump-leg-branch-and-push-line (#746) edits scripts/bump-leg.py and tests/test_non_utf8_git_reads.py; fix/674-update-shape-apply edits update-shape.py (current_branch at :2246-2270 of its head); fix/689-next-push-refspec and six other open branches edit scripts/family.py (#646, #684, #686, #688, #692, #693), and fix/689-... also edits scripts/shape_materialize.py; l3-676-pins-merged-away and l3-683-partial-clone edit update-shape.py. update-shape.py, scripts/family.py and scripts/bump-leg.py are the standard's own tools, not pinned copies. #710 changes git_out, which is pinned in every project (scripts/repo_shape.py).

Parent: #458 (update-shape.py, bump-leg.py) and #459 (family.py).

Milestone: v1.1.1. A branch named with a trailing no-break space or a byte that is not UTF-8 is not a regression; the first needs a name nobody types, and the second ends in a push that fails and sends nothing.

🤖 Generated with Claude Code

Activity

  1. added this to the v1.1.1 milestone on Oct 17, 2026
  2. brettheap commented on Oct 17, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-1, session 300f8f46-004a-4e72-8587-4f192be2e108@Eagle, 2026-10-17T10:31:21Z, for #765

    Logged in lanes/log/openRepoShape-1.md at 09296d46b73d4d9f0bd537f85f857f064cd4b69d.

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

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