diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-19 20:42:12 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-19 20:42:12 +0200 |
| commit | f6a2524658e113561a102f86997f9e236f22e9d8 (patch) | |
| tree | 4215899feca591308070480c46daa319a1c42726 /docs/superpowers/specs | |
| parent | 2d58a44858417510f31ab31bc6f6c54abdbc5503 (diff) | |
| download | desktop-assistant-f6a2524658e113561a102f86997f9e236f22e9d8.tar.gz desktop-assistant-f6a2524658e113561a102f86997f9e236f22e9d8.zip | |
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.
Diffstat (limited to 'docs/superpowers/specs')
| -rw-r--r-- | docs/superpowers/specs/2026-10-19-clone-tool-design.md | 14 |
1 files changed, 9 insertions, 5 deletions
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 `<root>/<folder>/<repo>` (`CLONE_ROOT`, default - `~/Programming/GIT`). +- Target is `<root>/<folder>/<owner>-<repo>` (`CLONE_ROOT`, default + `~/Programming/GIT`). The name is just `<repo>` 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. |
