Skip to content

Commit 8e6163b

Browse files
committed
docs(import[gitlab]) Add subgroup targeting and workspace structure table
why: Live testing of all permutations revealed two undocumented behaviors: slash-notation for direct subgroup targeting and the workspace nesting rules relative to target depth. what: - Add "Subgroup targeting" section with slash notation examples - Add workspace structure table covering all target/flatten combinations - Clarify that --flatten-groups is a no-op when target is already a leaf
1 parent 6b1d004 commit 8e6163b

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

docs/cli/import/gitlab.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,24 @@ Import repositories from GitLab or a self-hosted GitLab instance.
1414
:path: import gitlab
1515
```
1616

17+
## Subgroup targeting
18+
19+
Use slash notation to target a specific subgroup or sub-subgroup directly:
20+
21+
```console
22+
$ vcspull import gl my-group/my-subgroup \
23+
--mode org \
24+
--workspace ~/code/
25+
```
26+
27+
```console
28+
$ vcspull import gl my-group/my-subgroup/my-leaf \
29+
--mode org \
30+
--workspace ~/code/
31+
```
32+
33+
The `TARGET` argument accepts any depth of slash-separated group path.
34+
1735
## Group flattening
1836

1937
When importing a GitLab group with `--mode org`, vcspull preserves subgroup
@@ -27,6 +45,22 @@ $ vcspull import gl my-group \
2745
--flatten-groups
2846
```
2947

48+
### Workspace structure by target and flag
49+
50+
Given a group tree `my-group → sub → leaf`, importing from `~/code/`:
51+
52+
| Target | `--flatten-groups` | Workspace sections written |
53+
|--------|:-----------------:|---------------------------|
54+
| `my-group` | no | `~/code/`, `~/code/sub/`, `~/code/sub/leaf/` |
55+
| `my-group` | yes | `~/code/` only |
56+
| `my-group/sub` | no | `~/code/`, `~/code/leaf/` |
57+
| `my-group/sub` | yes | `~/code/` only |
58+
| `my-group/sub/leaf` | no | `~/code/` only (leaf — no further nesting) |
59+
| `my-group/sub/leaf` | yes | `~/code/` only |
60+
61+
When the target is already the deepest group (a leaf), `--flatten-groups` has
62+
no effect — all repositories already land in the base workspace.
63+
3064
## Authentication
3165

3266
- **Env vars**: `GITLAB_TOKEN` (primary), `GL_TOKEN` (fallback)

0 commit comments

Comments
 (0)