Skip to content

writ names a cloned repository by its layer; it should name it the way git clone does #793

Closed

Description

@David-Noble-at-work

writ repo add <layer> <repository-url> clones into XDG_DATA_HOME/devlore/writ/repos/<layer>: three clones
named base, team and personal, whatever repositories they are. base, team and personal are the right
names for the layers -- the registration, the link -- and the wrong names for the repositories.
writ repo list should say at a glance which repository each layer is, and a directory named team says
nothing.

Ruled 2026-09-04: the clone directory takes the name git clone would give it -- the "humanish" part of
the URL: the last path component, with a trailing / and a .git suffix stripped, so
[email protected]:NobleFactor/noblefactor-ops.git clones to .../repos/noblefactor-ops and
[email protected]:David-Noble-at-work/personal.git to .../repos/personal. The layer name stays on the
registration. writ repo list shows layer, repository and path, so the mapping reads in one line:

base      noblefactor-ops   ~/.local/share/devlore/writ/repos/noblefactor-ops
team      devlore-cli       ~/.local/share/devlore/writ/repos/devlore-cli
personal  personal          ~/.local/share/devlore/writ/repos/personal

Two layers whose repositories share a humanish name would clone to one directory; git itself refuses to
clone into an existing one, and writ refuses the same way, naming both layers.

Acceptance

  • a URL clone lands under the git-derived name, asserted for the .git, trailing-/ and bare forms
  • writ repo list shows layer, repository name and path
  • two layers resolving to one repository name are refused with a message naming both
  • the guide docs/guides/writ/repositories.md says where a clone lands and why

Ticked 2026-09-19, pulled forward from #894 into #898 by ruling of 2026-09-19. humanishName in
cmd/writ/writ/repo_cmd.go is git's guess_dir_name reduced to the URL forms isRepositoryURL admits;
TestHumanishName_Table asserts .git, trailing /, bare, scp-like, and three refusals; TestRepo_Set_ClonesURL_DefaultHome
proves team-env.git lands at repos/team-env through the command; TestRepo_Set_RefusesTwoLayersOneName proves
the refusal names both layers and clones nothing. writ repo list says which repository a layer is in its source
column, which stands for "repository name" here. The layer-journey scenario's step 1.2 is the end-to-end test on
six platforms. Plan: docs/plans/feature/791-repo-set-and-unset.md, Requirement 7 and Phase 9.

Plan and design documents

Kind Document
Plan docs/plans/feature/791-repo-set-and-unset.md

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions