feat(branch): add +all and keyword filtering for +list #377

Merged
wbtiger merged 1 commits from Taoyouce/gitlink-cli:feat/branch-all-and-filter into master 2026-07-14 20:36:47 +08:00
Contributor

What

Two gaps against the v1 branches API (Api::V1::Projects::BranchesController):

  • branch +list had no way to filter — the index supports a keyword name filter (forwarded to gitea-hat as name). Added -k/--keyword.
  • The dedicated GET /branches/all endpoint (full branch name list, no pagination) had no CLI counterpart. Added branch +all.
gitlink-cli branch +list -k feature      # filter by name keyword
gitlink-cli branch +all                  # all branches, no pagination

Note: /branches/all returns a top-level JSON array; structured (non-string) rendering of such responses composes with the fix in #339.

Validation

  • Production-verified on gitlink.org.cn: keyword narrows total_count to matching branches; /all returns the complete branch set.
  • 2 new unit tests (keyword query forwarding, /all path); go test ./..., go vet, gofmt all clean.
  • README examples and bilingual i18n keys included.
## What Two gaps against the v1 branches API (`Api::V1::Projects::BranchesController`): - `branch +list` had no way to filter — the index supports a `keyword` name filter (forwarded to gitea-hat as `name`). Added `-k/--keyword`. - The dedicated `GET /branches/all` endpoint (full branch name list, no pagination) had no CLI counterpart. Added `branch +all`. ```bash gitlink-cli branch +list -k feature # filter by name keyword gitlink-cli branch +all # all branches, no pagination ``` Note: `/branches/all` returns a top-level JSON array; structured (non-string) rendering of such responses composes with the fix in #339. ## Validation - Production-verified on gitlink.org.cn: keyword narrows `total_count` to matching branches; `/all` returns the complete branch set. - 2 new unit tests (keyword query forwarding, /all path); `go test ./...`, `go vet`, `gofmt` all clean. - README examples and bilingual i18n keys included.
Taoyouce added 4 commits 2026-07-08 22:03:01 +08:00
2e92db38d7 feat(branch): add +all and keyword filtering for +list
- branch +list -k/--keyword: filter branches by name keyword (passed
  through to the v1 branches index)
- branch +all: list all branch names via /branches/all, no pagination

Production-verified on gitlink.org.cn (keyword narrows to matching
branches; /all returns the full set). 2 new unit tests, README
examples, and en-US/zh-CN i18n keys.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
wbtiger merged commit df36a9aa40 into master 2026-07-14 20:36:47 +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#377
No description provided.