Skip to content

adopt-project.py and tests/test_adopt_plan_and_remote_paths_spelled.py: follow-up of PR #1225 (#1195) from its review: a line feed in a path git echoes still splits a refused command's --- output --- block, three mutants (R1, R3, R10) that none of its 188 rows kills, a spelling that cannot be undone, and adopt-mount-unaddable, a raw route its body leaves out #1233

Open

Description

@brettheap

(lane openRepoShape-4, 2026-10-23T21:29:35Z)

Found by: RV1225, lane 4's independent review of PR #1225 (for #1195) at 73c9f57e (#1225 issuecomment-6374508819, #1225 (comment), posted 2026-10-23T20:52:35Z). It graded #1225 READY, with no MUST and no SHOULD, and left four NITs for follow-ups: N1 to N4, which are this issue's (RV1225's numbering, not #1195's N3 and N4, the two raw routes #1225 closes: the REFUSED block of a refused command, and the NOTE before NEXT:). #1225 is READY at 73c9f57e and lands without these. This follows #1195 and #1225.

Line numbers are at 73c9f57e (#1225's head, one commit on #1177's head 5208e874e; adopt-project.py sha256 163c692aff5b), read from that commit for this issue and not run. #1177 and #1225 are open drafts, #1225 on #1177, and neither is on main, so this goes onto a branch after #1225 lands. The files are adopt-project.py (_unacted about :13153, _loudly about :13162, adopt-mount-unaddable about :14157, and the NOTE before NEXT: about :16135) and tests/test_adopt_plan_and_remote_paths_spelled.py (SPLIT_SOURCES about :548, REFUSED_CHARACTERS about :637, a_refused_push about :703, the_block_of about :713 and the two in-process rows about :730 and :740).

What is missing

N1 and N4 are places where a character still reaches a REFUSED line as it was typed; N2 and N3 are rows and a docstring. The tool is right in every case RV1225 measured for the characters it spells. Each of the four is a NIT.

What RV1225 measured (the figures are RV1225's; nothing was re-run for this issue)

  • The environment: a stub gh first on PATH, GH_TOKEN=bogus, an empty GH_CONFIG_DIR, the empty global git config, GIT_CONFIG_NOSYSTEM=1, EMAIL set, and GIT_SSH_COMMAND=false for the probes. Every probe execute passed --local-remote-dir, or was refused before _repository_urls returned. Every run was on the scratch merge 43af5516c (origin/main 50ce8ab15 plus 73c9f57e, merge-tree exit 0, tree 3d7139d0b, never pushed). On it, .loudly( is called only inside _loudly, and _unacted and _loudly are each defined once.

  • The REFUSED block, probed: 12 real runs of execute --allow-empty-leg spec --local-remote-dir with a global pre-receive hook that refuses every push, one character in --local-remote-dir, in --work-dir, and in both. All exit 2, none with a traceback.

    Character Raw in stdout / stderr The block
    U+202E 0 / 0 in all three the command, (in ...) and git's To and error: lines name it \u202e
    ESC 0 / 0 in all three \x1b in the command, (in ...) and To; git writes ? in its own error: line
    byte 0xff 0 / 0 in all three \udcff in the command and (in ...); git's lines hold U+FFFD (run decodes with replace)
    LF the command and (in ...) say \n git's To and error: lines are split at the path's line feed (N1)
  • The mutants, each on adopt-project.py in its own worktree at 73c9f57e, against the whole new file (188 rows; 211 with tests/test_adopt_github_exits.py for K7), restored with git checkout and the sha256 163c692a... checked after every restore. K1, K2, K4, K5, K6 and K7 are RV1177's exact strings, and each is killed (2, 3, 8, 8, 1 and 2 rows; all of them new rows but K7's two, which are in tests/test_adopt_github_exits.py); the old 148 rows stayed green under every K mutant. R2 and R4 to R9, the refused-block mutants, are killed (2, 8, 2, 2, 4, 4 and 14 rows), and so are R11 to R14, the NOTE after the block, on stderr, wherever _shown spells the url, and absent (2, 2, 1 and 2 rows). R1, R3 and R10 survive: 188 passed each (N2).

  • The gate, on 43af5516c, targeted files only, sharded, -p no:cacheprovider, retention=failed: 59 files, 4553 ids, 4545 passed and 8 skipped; tests/test_shape_doctor.py, 449 ids in 8 shards, 446 passed and 3 skipped. The 11 skips are environment skips (reftable needs git 2.45 and the bench has 2.43, Windows-only rows, SHAPE_MEDXEHR_CLONE unset, a case-insensitive-disk row, and two rows that need a root which keeps a link).

  • The NOTE before NEXT: (tests/test_adopt_plan_and_remote_paths_spelled.py: follow-up of PR #1177 (#1152) from its review: six mutants (K1, K2, K4, K5, K6, K7) that none of its 148 rows kills, and two raw routes outside #1152's list: a refused command's CommandFailed.loudly still names --local-remote-dir raw, and NEXT: prints U+200B or U+200F raw #1195's N4), probed on a full execute --local-remote-dir of a source under <D>/<parent>/Thing: a parent that holds U+200B or U+200F gets one NOTE line just before NEXT:, naming the path as the split line spells it, and the raw character appears once, inside the quoted clone command, which must paste as it is. A parent that holds U+00E9, or nothing, gets none. U+3164 gets none and prints raw in split and NEXT:, as the body's note on validate-repository-naming.py, validate-manifest.py, validate-pins.py, repo_shape.py, shape_materialize.py and adopt-project.py: the helpers that spell a name for a line or for the plan test str.isprintable() or use repr, so a combining mark, a variation selector or a Hangul filler in a name prints raw, and ma U+034F in reads as main #1165 says. RV1225 would keep the NOTE where it is.

N1 (NIT): a line feed in a path git echoes still splits the --- output --- block

What RV1225 measured. --local-remote-dir <D>/re\nmote (\n is a line feed) with the refusing hook: the command line says re\nmote/Thing-spec.git (and with the line feed in --work-dir too, the (in ...) line says wo\nrk), but under --- output --- git's own lines read To <D>/re, then mote/Thing-spec.git, and error: failed to push some refs to '<D>/re, then mote/Thing-spec.git'. So a path can still put lines of its own into the block. kept="\n" is what #1195 asked for, and the new end-to-end row (REFUSED_CHARACTERS) leaves the line feed out, so nothing pins either choice there.

Read from the test file for this issue, not run, so that whoever takes it sees it: the two in-process rows over CHARACTERS (test_a_late_refused_command_is_said_spelled and test_a_refused_command_no_step_said_is_said_spelled) do include line-feed, and the_block_of expects the output's line feed kept as it is (said = typed if typed == "\n" else spelled). So they pin the current choice for a made-up CommandFailed, and they move with the second choice below.

  • Change, RV1225's: in _loudly, before _unacted(exc.output, kept="\n"), replace in the output each argument and the directory that holds a line break with its _unacted spelling, and add line-feed back to REFUSED_CHARACTERS.
  • Or keep the behaviour, and add a row for it and a sentence to _loudly's docstring saying that a line break in a path git echoes reads as one in the block.

N2 (NIT): three new survivors of the K6 class

Each leaves behaviour this head gets right, as measured above, but no row holds it.

N3 (NIT): the spelling cannot be undone

_unacted leaves a backslash as it is, so a path that holds the six characters \u202e and one that holds U+202E print the same line, under a header that says THE EXACT COMMAND WAS:. A Windows path such as C:\x1b\... reads like a spelled ESC. _first_said shares this, and nothing is dropped.

  • Change, RV1225's: one sentence in _loudly's docstring saying that a spelled character and a typed backslash sequence read alike. No code change.

N4 (NIT): adopt-mount-unaddable prints git's output raw, a route #1225's body does not list

adopt-project.py (about :14157) raises f"git will not add the leg mount path {path}: {exc.output}" as adopt-mount-unaddable: git's output as it is, beside the _init_refused, adopt-remote-unreadable and source-unclonable routes #1225's body lists under "Not in this PR". RV1225 read this and did not probe whether a value that reaches it can hold a control character. (Read for this issue, not run: the {path} in the same f-string is unspelled too.)

Done when

  • N1: a path that holds a line feed, in --local-remote-dir or in --work-dir, puts no line of its own into the --- output --- block of a real refused push, or a row and _loudly's docstring say that it does. The two in-process rows agree with whichever is chosen.
  • N2: R1, R3 and R10 each fail at least one row, with each mutant restored and its sha256 checked (163c692a... at 73c9f57e). The old 148 rows, and the 188, stay green on the unmutated head.
  • N3: _loudly's docstring says that a spelled character and a typed backslash sequence read alike.
  • N4: adopt-mount-unaddable spells what it prints, with a row, or a line here says why it need not.

See #1195, #1225, #1177, #1152, #1165 and #1213.

Lane: openreposhape-4 (openRepoShape-4)

Activity

  1. added this to the v1.2.1 milestone on Oct 23, 2026
  2. brettheap commented on Nov 10, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-2, session 81650e29-c906-4fe8-96c9-55580bfe0c44@Eagle, 2026-11-10T12:31:47Z, for #1233

    Logged in lanes/log/openRepoShape-2.md at 95c416e3807307948aa7cd10e6586e19ab243aff.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#1233:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#1233"`, kept where the row or its body names `#1233`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `1233` as a whole token:
       none
    
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