From f6a2524658e113561a102f86997f9e236f22e9d8 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 19 Oct 2026 20:42:12 +0200 Subject: clone tool: name the target owner-repo A generic repo such as evgen2571/wallpapers cloned into wallpapers; the target now takes the owner's name, collapsing when owner and repo match and falling back to the bare name when the URL has none. --- docs/superpowers/specs/2026-10-19-clone-tool-design.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/superpowers/specs/2026-10-19-clone-tool-design.md b/docs/superpowers/specs/2026-10-19-clone-tool-design.md index 09d3be5..fde9002 100644 --- a/docs/superpowers/specs/2026-10-19-clone-tool-design.md +++ b/docs/superpowers/specs/2026-10-19-clone-tool-design.md @@ -32,14 +32,18 @@ timeout = 300 `examples/tools/clone.sh`: - Parses `https://host/owner/repo` and `git@host:owner/repo` alike; `repo` - is the last path segment with a trailing `/` and a `.git` suffix removed. - Both `host` and `repo` are validated as plain names, so neither can - escape the tree. + is the last path segment with a trailing `/` and a `.git` suffix removed, + and `owner` is the segment before it (a nested group keeps only its last + segment). `host`, `repo` and `owner` are validated as plain names, so + none can escape the tree. - Resolves `host -> folder` from the mapping file. Absent, it is seeded with `github.com -> GITHUB`, `gitlab.com -> GITLAB`, `forge.slackware.nl -> FORGE`. -- Target is `//` (`CLONE_ROOT`, default - `~/Programming/GIT`). +- Target is `//-` (`CLONE_ROOT`, default + `~/Programming/GIT`). The name is just `` when the URL carries no + owner (`git@host:repo.git`) or when `owner` and `repo` are the same + (`firefly-iii/firefly-iii`), so a generic repo name like `wallpapers` + becomes `evgen2571-wallpapers` while a self-named one is not doubled. - Known host, target free: `git clone` and report it. No question. - Unknown host: prints the folder to offer (hostname without its last label, uppercased: `codeberg.org -> CODEBERG`) and does nothing. -- cgit v1.2.3