feat(label): add label +clone to copy labels from another repository #367

Merged
wbtiger merged 1 commits from heke1228/gitlink-cli:feat/label-clone into master 2026-07-14 22:24:52 +08:00
Contributor

背景

对标 gh label clone。把源仓库的全部标签复制到当前仓库:按名称已存在则跳过(gh 语义),仅 --force 时就地 PATCH 覆盖(保留标签 id 与其 issue 关联)。

改动

  • 新增 label +clone --source owner/repo [--force],纯组合现有的 list + create/update 端点。
  • 新增自包含的分页 helper fetchLabelsForRepo(遍历 issue_tags 列表;实测端点确实支持 page/limit),并带 id 去重终止,即使端点忽略分页也不会死循环。
  • 不改动现有 fetchLabel,以避免与 PR #363(fix/label-update-pagination)冲突。

验证

新增测试:clone 新建/按名跳过/--force 覆盖;fetchLabelsForRepo 遍历两页。go build ./...go test ./shortcuts/label/ 通过。

## 背景 对标 `gh label clone`。把源仓库的全部标签复制到当前仓库:按名称已存在则跳过(gh 语义),仅 `--force` 时就地 `PATCH` 覆盖(保留标签 id 与其 issue 关联)。 ## 改动 - 新增 `label +clone --source owner/repo [--force]`,纯组合现有的 list + create/update 端点。 - 新增自包含的分页 helper `fetchLabelsForRepo`(遍历 `issue_tags` 列表;实测端点确实支持 page/limit),并带 id 去重终止,即使端点忽略分页也不会死循环。 - **不改动现有 `fetchLabel`**,以避免与 PR #363(fix/label-update-pagination)冲突。 ## 验证 新增测试:clone 新建/按名跳过/`--force` 覆盖;`fetchLabelsForRepo` 遍历两页。`go build ./...`、`go test ./shortcuts/label/` 通过。
heke1228 added 1 commit 2026-07-08 12:43:40 +08:00
44d2ba0db2
feat(label): add label +clone to copy labels from another repository
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
wbtiger merged commit 67397c2bd4 into master 2026-07-14 22:24:50 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#367
No description provided.