Skip to content

fix(writ): writ repo set uses the clone an earlier run left, gives the branch asked for, and says what it did - #1126

Merged
David-Noble-at-work merged 6 commits into
developfrom
fix/983-writ-repo-set-refuses-a-url
Oct 22, 2026
Merged

David-Noble-at-work merged 6 commits into
developfrom
fix/983-writ-repo-set-refuses-a-url

Conversation

@David-Noble-at-work

@David-Noble-at-work David-Noble-at-work commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lane 45 of #949.

  • The clone an earlier run left is used (writ repo set refuses a URL layer whose clone directory exists from an earlier, unregistered run: the rerun cannot recover #983). writ repo set <layer> <url> refused any existing destination, so a clone that landed and whose registration then failed made the same command fail on the rerun, against the idempotency ruling ("running the same command again is the recovery"). A destination that is a git working tree whose remote is the URL given (D1: compared as written) is now registered without cloning again; anything else there is refused, saying what it holds: not a git working tree, or a clone of another remote, named.
  • The branch asked for, by either form (ruled 2026-10-21). --branch applies to a path as well as a URL. For a tree already on disk (D2): git fetch origin; git switch <branch>, which creates it from origin's when only origin has it, and is refused, registering nothing, when the branch is nowhere or uncommitted changes would be overwritten; then git merge --ff-only origin/<branch> when it is behind, a branch with commits origin lacks being left as it is. Without --branch the tree is left on what it has checked out. A fresh clone takes git clone --branch, as before.
  • It says what it did: "found a repository at , on ", "cloned into , on " or "found the clone of at , on ", with ", switched from to ", "fetched origin", "fast-forwarded to origin/" or " has commits origin lacks; left as it is". The help says what --branch does.
  • Tests. Ten new ones (the leftover clone; another remote; not a tree; no branch; a local branch; a branch pushed since the last fetch; a branch nowhere; a switch blocked by uncommitted changes; behind; diverged), and TestRepo_Set_Errors' branch case, fail against repo_cmd.go before the fix and pass with it.
  • Plan: docs/plans/fix/983-writ-repo-set-refuses-a-url.md.

Resolves #983

Test plan

  • The new tests fail against the old repo_cmd.go and pass with the fix; make test
  • This script's pre-flight: make check-all
  • CI on this pull request, every leg

Written with AI assistance.

Signed-off-by: David Noble [email protected]
Assisted-by: Claude Code

Time

Marker UTC Elapsed
opened (first commit) 2026-10-21T23:20:33Z —
submitted (PR opened) 2026-10-21T23:51:14Z 0.5 h after opened
merged 2026-10-22T00:07:28Z 0.3 h after submitted; 0.8 h in all

Computed by the algorithm of noblefactor-ops#188 at merge.

… the branch asked for, and says what it did (#983)
…e branch asked for by either form, and says what it found and did (#983)
… their own, and plannedRoot takes no branch, for the linters; the plan's gate box, ticked in error, is unticked (#983)
@David-Noble-at-work
David-Noble-at-work merged commit 272e6a9 into develop Oct 22, 2026
21 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the fix/983-writ-repo-set-refuses-a-url branch October 22, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

writ repo set refuses a URL layer whose clone directory exists from an earlier, unregistered run: the rerun cannot recover

1 participant